How can I scripts automatically before hibernation and after waking up form hibernation? I am searching for something similar to the Logon/logoff and startup/shutdown scripts feature.
There's nothing built into the OS, but you can get a dev to code something for you...you need to capture the WM_POWERBROADCAST event that fires when the system changes state.
You could replace "FileAppend" with another AutoHotKey command.
You could make something up in Powershell probably but until Powershell 2.0 is released the "run in the background" capability isn't the best. There is a Powershell example in this thread in any case.