I don't know of a computer that detects a power outage. Notebooks, switch to battery then when battery power is low it supenses the programs and shuts down. As far I know most people use a UPS, and when I outage is detect by the user the user shutdown the computer after the current process is finished. Some UPS software can shutdown the computer when UPS battery get lows, similar to a notebook computer. Most UPS have at least a 10 mintue standby time.
The best options is to make complete backups of your computer at least once a month and daily backups of your application. I don't know many scripts that take that long to run, with the speed of computers these days, but I would make a backup before I ran such a large script. You could make the backup part of the script.
Good idea... Will implement that!
Build a set of "If's" into the script and eat the elephant one bite at a time
Define a non-global field on a separate table just for the reptitive script
Break your lengthy script into bite sized chunks (functional tasks) and end each section with SetField( the field ; "task log complete")
The next section starts with If (thefield = "task log complete") and ends with SetField( the field ; "hourly wage complete") and on and on.
In this way, even if the script is interrupted, it can pick up where it left off when it runs next time.