Close, well done. Main is not necessarily the first in the queue.
Its more a
"Pause this function until all other queued functions have had ONE turn at this frame,
then unpause this function WHEN its turn in the queue arrives next frame.
Or even more simply (and a little too simple)
"Pause this function until THIS FRAME has been drawn.
This is not an easy concept, but once you get it you'll wonder why it seemed so hard.
What happens is, whenever ANY function hits a WAIT()it pauses.
This continues until ALL functions are paused, then the current FRAME is drawn.
Then the functions are un-paused one-by-one, in approximately the same order they got paused in.
Each function will un-pause, run its code until it hits a wait(), then re-pause.
Then the next function in the queue will take its turn, etc, until all have had one turn this frame.
Then the now current frame get drawn, and the cycle starts again with the first function in the
queue getting called and so on.