take apart the keyboard and put a small sticker in between one of the ply's of plastic so it doesn't connect electrically when you push the home key.. and for the closing, you'll have to disable the switch.
There could be an easier way, but I don't know it.