You don't want to close the lid when you have an ssh session running or IRC? That is non-sensical.
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...
Then you might have to wonder if yours is maybe not the typical use case.
Just sayin...