Sorry, but I don't understand your problem either.
What is your main loop dooing ?
Why using this main loop, aren't the normal events sufficient ?
You could set flags to manage different options in your routines.
Your question reminds some old days, before event driven OS's, when we had to manage a main loop waiting for user inputs to call the requested routines and having also some subloops to manage submenus and so on.
Could you post some code that we could have a closer look at, and better understand your needs.
Best regards.