I have the last revision PowerBook, which has the hibernate mode option (Safe Sleep), and I started to use Safe Sleep in place of simple sleep since I first found this helper script here on macosxhints.com
The problem is that I get kernel panics randomly when my PowerBook comes back to life, and don't know why. So I decided to modify the script. Another motivation is that I wanted to switch back to the login window in order to have a simple way to lock my computer. And I discovered a way to do just that. The trick here is to use CGSession to suspend the current user account using the Fast User switching option.
So here's an AppleScript that just does both things: first, switches to the login window, and then enters Safe Sleep mode. You can attach this code to any launcher, macros, combo keys as usual. Please note that my script has no way to set the hibernatemode back to normal, so if you use this, don't forget to get back to normal sleep with the command pmset -a hibernatemode 3.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20061116062825314