I spent a bit of time trying to do it with flex sensors. Strap one to your hand, make a fist, take your nap, detect when muscle tone is lost and it unbends. I ran out of interest before I got it to work but I still think it's viable. Probably smart to build the flex sensor into a glove for ease of use, and you could put the microcontroller on there too.