Shutdown control alternative
I found an alternative to Shutcontrol that I like a lot better. It is called RMClock Professional Features Module. I basically used it to create an event that monitors when the power source switches to battery and then made an action to put the computer into hibernate once that event has been triggered for 3 seconds. It's a nifty little app, but it does cost a little. You can create as many events and actions that you want and one of the actions is to run a program, so you could set it up to run pre and post scripts as well.