Really? Are you doing something over IRC or SSH with the lid closed? I normally don't talk to irc with the lid closed, because I can't reach the keyboard that easily...
If you want something on the other side of the SSH to continue, use sleep or tmux.
If you want to keep your session, well, keep your lid open...
What's with you people? What's next?
"If I have an ssh session running, I don't want the machine to stop when I remove the battery and the charge plug"?