While not a game, I found the
Remee Kickstarter project to be a fascinating, albeit not new idea.
It's basically an affordable, comfortable sleep mask with LEDs that are supposed to help you achieve lucid dreaming (being aware that you're in a dream -- yes, like in Inception). Usually, LDing is something you have to train yourself for, but devices like this are known to speed up the process considerably.
It does not automatically detect REM sleep phases, but with a little bit of fine tuning, this should not be a major problem.
Again, sorry for the off-topic, but making a thread just for this seemed like an overkill.