I've been looking through the 2007 annual review of the UK Intellectual Property Office, and it has reminded me that the Waker-Upper 3000 was the winner of the 2007 Cracking ideas Competition. It was designed by nine and ten-year olds at a school in Devon, and the idea is to keep the user awake when doing homework.
There are in fact numerous patents for inventions that prevent dozing, mainly for the sake of drivers or pilots, or for operators of machinery. G08B21/06 is the class for "anti-dozing alarms", and can be used in the popular Espacenet® database's advanced search page. Enter the class in the bottom, IPC search box and you are away.
Adding for example US (in the publication number box) limits the search to American patent publications, GB limits to British and so on.
I haven't looked at more than a few of the hundreds of patents, but many clearly involve monitoring the closing of eyes for obvious reasons. They include the illustrated Monitoring Drowsiness patent by Loadpoint Limited of Swindon, Wiltshire. I also like the Driver Drowsiness Monitor and Recognition System by a private inventor from Coventry.

Comments