Yes, this can be done. Check out the "Events" in the macro language.
http://kmeleon.sourceforge.net/wiki/MacroLanguage2#events
Many macros in the macro library
http://kmeleon.sourceforge.net/wiki/MacroLibrary use the startup events to time when to build their menus.