I developed the following simple Launch Daemon to provide a 'wake' trigger for scripts on Leopard:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>wake-alert</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>z=/tmp/wake; test -s $z || { date > $z; say w; };
tail -1 /Library/Logs/DirectoryService/DirectoryService.server.log | grep -v Sleep || > $z
</string>
</array>
<key>WatchPaths</key>
<array>
<string>/Library/Logs/DirectoryService/DirectoryService.server.log</string>
</array>
<key>ExitTimeOut</key>
<integer>2</integer>
<key>ThrottleInterval</key>
<integer>1</integer><integer>
</dict>
</plist>
You can replace 'say w' with your code. I write a date to z but you could change this to write anything. You may need to increase 'ExitTimeOut' for some scripts. My Launch Daemon resides at /Library/LaunchDaemons/wake-alert.plist
The Launch Daemon watches DirectoryService.server.log and writes to a temporary file provided the file is empty. The file is cleared by a log 'Sleep' entry and by Shut Down.
If you use 'fast user switching' to sleep you will find that scripts which require a logged in user will attempt to run too early and fail unless you modify the Launch Daemon - perhaps grep 'Succeeded' in 'secure.log'.