Those were FA's (False Awakening). Basically your mind tricks you into believing you woke up for real. FA is a good way to become lucid if you can catch it. Everytime you wake up, perform a reality check, and you will know you are dreaming. Sounded like you had a long run of lucidity, you could have had some fun instead of trying to get out, but I can understand you if you were scared etc.

I also had a dream where I felt I was stuck and the only way was to commit suicide. I was on a building too(rooftop) and jumped off the edge but flew around instead(I was semi-lucid).