Hi,
no, not directly.
When you call an M code the Gcode interpreter has control of the machine, that is Machs Core chunk.
The function whose code you posted is in the screen load script , that is its part of the GUI chunk.
Only one chunk can run at a time.
You can make your own M code using the same API's although I wouldn't bother with the co-routine part.
Craig