m.top.dialog = m.dialog
print "after show", m
result = askDialog() ' <- dialog invoked here.
while myScene.dialog <> invalid
You'll have to change the way you think about this. You'll have to break your code in two pieces - the one "after" the dialog put in a different function, which is observing for change of say myScene.dialog field - or onKeyEvent() one
See if https://sdkdocs.roku.com/display/sdkdoc/Dialogs+Markup can be of help.
For a fake modal dialog have you considered pausing all the other routines when it is displayed? That way the render thread would simply be running and not changing anything.
Not all, just the current thread.
This in not a fake modal dialog, but real
This is standard behaviour for the modal dialog on traditional systems.