Change keepRunning to a flags field and add a flag to pause a script (not yet used).