First I would make sure that the project is fully optimized. -O3 on source to bitcode for each file, and -O3 when building all the bitcode to JS.
You might be able to split up the main loop into smaller pieces, and call each asynchronously from the other (emscripten_async_call, etc.).
Profiling using the browser devtools might find why things are slow, it could be something that can be optimized.
Otherwise, you can look at the emterpreter option to add an async wait inside running code (emscripten_sleep), but it makes code run more slowly, so it might not help in your situation:
https://github.com/kripken/emscripten/wiki/Emterpreter