You can have some listener monitoring some variable in the base workspace that indicates when your script have finished and then do something. Like let's say the script will create a variable that's called "scriptIsDone". Then you can just use evalin() to check it
scriptIsDone = evalin('base', 'scriptIsDone');
Put it in a loop or use a timer or something so you repeatedly check it.