Simple Rhino macro run through ghpython disables grasshopper control

Try this:

You can also try holding down the button till the process is done running, that usually works for me when e.g. capturing the viewport to an image.