If you're on a Mac and you have an external hard drive you could use the Time Machine, which will save states of your computer every half hour. That way if your computer decides to power down you'll only lose half an hour of work. Otherwise if you know anything about setting up scripts you could just set it to press crtl+s every couple of minutes....or just remember to press ctrl+s every so often.
Currently cleaning my rats cage.