Was I about to go lucid? And then lost control and woke up in SP?
That's what it sounds like to me, but Im not all that experienced. Maybe someone else will know better than I do.

If this happens again in the future what should I do to stay in the dream or go back in once in SP?
I'd say try to relax and stay in the dream, Usually it's excitement that kills everyones' first few lucid experiences. So it's pretty normal to get excited like that and wake up. It's all about learning to 'go with the flow' - not get too excited, and just let the dream take you where it will. Don't try to force anything.

... And if you do wake up, try to DEILD right back into it, and - failing that, then get up for a while and then do a WBTB.

Maybe telling yourself what happens in the dream will happen IRL wasn't such a good idea.

That's probably why you got paranoid... it created tension that wouldn't have been there otherwise. I wouldn't try that again... but that's just me.