Within a script, there are the predefined routines like @Initialize, @MainLoop, etc. These are predefined because they have special behaviour relating to that running script that is hardcoded as part of the engine. The actual execution flow of a "script" will start by doing some internal initialization stuff, interpreting and running @Initialize and @Loading, then when done will run @MainLoop once per frame, and also once per frame internally checking if conditions to run @Finalize are met. A global event scheduler (I'm assuming it's global) likely also takes the whole stack of events being triggered and messages the event data to the relevant scripts, and on that frame, that script's @Event will be run once for every new event put in that script's event stack. (That or there's another mechanism for scripts to add events to all other scripts' event stacks somehow. Or, all events are done together outside of the individual script flow, but I doubt that.)
If the programmer starts a task in @Initialize, which is likely, that starts a coroutine. Once it yields or ends, the context switches back to where the task was called; in @Initialize, which again is part of the main execution flow of the "script". If the task started more tasks the same applies and it just builds a tree of new coroutines and eventually winds back to the initial context. The "tree"-ness of calling tasks from tasks only really matters when they're first called; once a task yields, that coroutine is just set up in a queue for the next frame. Once @Initialize is over, and I assume it's starting on the next frame, @MainLoop runs. @MainLoop will have some stuff in it, and importantly it (should) yield, which lets the context yield back to the first task queued in the task scheduler. Once that task yields (or ends) again, context switches to the next in the queue, and so on until it reaches the end of the queued tasks for that frame, and finally context comes back to @MainLoop, which maybe runs some more stuff and then ends.
If you're clever, you might notice that if you don't put a yield in your @MainLoop, you get a few interesting pieces of information: 1) @MainLoop does not halt, and will keep running once per frame; and 2) only the coroutines relevant to the script are never yielded back to. Because of this it can be concluded that task/coroutine scheduling is divided on the script-level and is not a global scheduler. Tasks "belong" to a script.
Now, I've been writing "script" in quotations here because as far as I can tell, scripts are structures that have similar organization to coroutines, but are one step up the chain, and ultimately do many more things. I'm fairly sure that Danmakufu doesn't particularly do any multithreading with this, and that scripts are simply run in order similarly to how coroutines are scheduled per task, but done in a more global fashion. Danmakufu does run more than one thread for running in general though.