I expanded on the previous script a little-
I may be the only one who wants this, but if anyone else would like to use/modify this script, feel free. I added the ability to 'cancel' the SafePower mode by just running the script again.
Its possible this turns out to be a bad idea, but it cannot be worse than just pulling the power. I have not tried it, but I imagine running in SafePower mode would also not present much problems as ultimately there just is not a lot of flash writing going on (at least in my case).