Something quick and easy to try.
Call up Control Panel from the Start Menu. If you are Viewing the Control Panel by Categories, click Hardware and Sounds and then Power Options. Now click Change What Closing the Lid does.
Set it Sleep, both on Battery and Plugged In. I think you have to reboot for these to take affect.
Next time the machine locks up, close the lid. Wait for it to fully go to sleep. (I can tell on mine it is asleep when the logo light on the cover goes out). Open the lid. Everything should be as before and the mouse and keyboard functional.
Not a real "fix" but a reasonable "work around".