You can read the lid state from:
Code:
/proc/acpi/button/lid/*/state
but I doubt that you can get anything to search for state changes while your laptop is actually in sleep. (i.e. I have no idea how or if that could work)