You don't, because messing with the game loop is a very bad idea.
And usually you don't have to do something like this.
Please tell us what you want to achieve (ingame terms) instead of how you want to achieve it (stopping the game loop), then someone might be able to tell you how to do that correctly.
This is for a plugin that imports dialogue and its associated parts. I am trying to make it so the dialogue has to be complete before the next event can fire.
That does not explain anything. There is absolutely no need to time loading here, and even if there were it would be much easier to make the plugin triggered by script command instead of being automatic.
So when you speak to a character in game the dialogue function runs and the player can click through it as should. However, in the mean time the character sprite you were speaking with is already walking away from you because its not waiting for the player to finish clicking through the dialogue, its just executing the following events immediately. What I am trying to do is make it so those events following the dialogue can not execute until the dialogue is complete.
How are you moving the events?
An events autonomous movement should automatically be stopped when the content is processed...
Can you give a screenshot of the event page?
I can't see the picture because the website you linked to requires registration before it shows the picture.
Solved.
The solution was to move actions to a separate event tile and call on it when ready using:
$gameMap.event(eventId).start()