The part where you think you've woken up are commonly called "False Awakenings." They're very typical in this sort of situation, exactly because you're on that borderstate between being awake and asleep.

Personally, I believe that the onset of sleep and the onset of dreams overlap slightly. You begin dreaming just a few moments before you begin sleeping (that's where Hypnagogic images come from). In the same vein, the ending has an overlap too. You continue to dream while already waking up (this often leads to people reporting that they heard strange sounds or saw something weird at the moment of waking).

So what happens here, is basically that your body is so close to awakening that you're right there in that shadow zone between actual waking and dreaming, hence the repeated attempts at waking which each time result in yet another dream, as you don't quite get to full consciousness yet.

Hope that makes sense,

-Redrivertears-