unfortunatly, for the moment, the "key" for when you're closing the lid isn't mapped... (try xev, and press it, you'll see). it's an issue a friend of mine dealed some years ago with his new keyboard, which had keys that wasn't map either.
I'll check my irclog, and i'll post it there... if someone wants to try, he'll have a begin. Sorry, i don't have the time to do it now myself... If no ones does, maybe i'll check in some weeks.