How to run scripts synchronized?

When called from a script running command, RhinoApp.RunScript() won’t return until the command has finished.

You can also watch for the Command.BeginCommand and Command.EndCommand events if need.