Every hour progressed in sleep at night sees a longer REM period and shorter stage two through four in what's called the REM sleep cycle. (http://sleepzine.com/wp-content/uplo.../rem-graph.gif) Eventually stage four and three vanish altogether and REM grows to encompass a significant part of your sleep. What you did is much like the Wake Back To Bed (WBTB) technique. You probably slept six or more hours and when you went to take the short nap you were primed to enter directly into REM and have a dream.