This issue was sooo annoying, I'm glad there was a fix to it.
Here's the xda thread for a fix.
http://forum.xda-developers.com/showthread.php?t=546094
You need to have MortScript installed, including the cabs for both.
I used the option to disable the short power button (the sleep button) but still be able to turn on the device if the keyboard is out by pressing any kb key. Works like a charm.