Changing focus.

When running Spe editor as a script inside of Blender I have noticed that you can’t change focus back to blender. Is there a way of allowing for a change of focus back to blender while a script is running.