It all depends on the microcontroller you're going to use. I'd suggest to go with a ATtiny45 or 25.

Secondly, you don't need any IR stuff, just two red LEDs. Preferably 3mm of diameter.

As for the REM detection... that's impossible. Instead look on the forum for the time the REM kicks in after falling asleep. It should be about 4 hours.
Just use a delay function in the code.