core.pauseScript() pauses the execution of the script. It can be resumed with the keyboard shortcut key that is assigned to actionResume_Script. The default seems to be ctrl-d r and can be overwritten in the config.ini file (or %APPDATA%\Stellarium\Config?).