I was looking for a way to hibernate the machine on demand. This is also useful if you want to conserve battery power (e.g. while one a plane). The sleep mode is a drain on the battery, because the RAM needs to be kept alive/refreshed. This is especially a problem, if you have a lot of RAM.
Found the following applescript. Seems useful.