He knows he said that he was going to 'move on' but after that dance they just shared he realized that it was never that easy.

He wishes that it was just a simple act of saying that you're moving on and then going to do it, but Caroline reminded him of the fact that some things are not that easy. She tells him that maybe one day he would have moved on without even realizing it but he knows that that's a bunch of crap. Stefan Salvatore will never be able to completely move on from Elena Gilbert because how does one move one from their one true love?

His head hurts from all these thoughts that are swarming around and he thinks of the beautiful girl lying in the downstairs basement.
He really wanted to stay and be there when she wakes up but he knows that it's not his position and he knows that the Elena that wakes up will not be the Elena he so deeply loves. This girl, this Elena, is a heartless vampire and he knows that he can't hold anything against her.
She never wanted this life, she told him so herself. So, that's why he knows he needs to do everything in his power to make sure she gets what she wants, to be human again.

He knows that the words that come out of her mouth now are the absolute harsh truth but that doesn't make it easier to hear them.
When she told him that it felt like his whole world revolved around her and that he was the one who maybe needed to turn off all of his emotions it really hit home. And, to be honest, he did contemplate flipping the switch for about all of ten seconds but then he realized that it wouldn't change anything.
There would be two vampires without their humanity, and how would he ever turn it back on again?
It would all be up to Damon and as much as he loves his brother, he knows that Damon isn't that great with emotions and his resolution would probably be to turn it all off too and then there wouldn't be any emotions involved whatsoever and then they would never be able to get Elena back.
For a split second he thinks back to Silas and how he appeared to be Stefan when he talked to Damon and he wonders what Silas said that could possibly hurt Damon. He thinks back on what Silas/Damon said to him in the woods before he staked him

"Maybe Stefan, it's just best if you leave. Don't you see that this is who Elena is now? Maybe we should stop trying to fix her; she doesn't want to be fixed"
Deep down, that's his greatest fear. That this is who Elena is now and that this Elena would be happiest with Damon.
But then he remembers that day, that day when Damon force-fed her his blood right before the ritual and the fact that she said that she never wanted to become a vampire. He knows that he has to hold on to that.
The Elena he knows, and so deeply loves, would never want to be what she is now, a heartless monster who kills people for fun. He also knows that when in time she does flip the switch every emotion she has suppressed is going to come back to haunt her and as much as he wants to be there for her when that happens, he knows he doesn't have the right anymore.
She's with Damon now, he's her boyfriend, and she is his responsibility.

As much as it will hurt seeing her go through all of that he knows that when the time comes, he has to leave. If he ever wants to be able to live a life without heartache, pain, suffering and guilt, he has to let her go.
He's done reliving history, he wants to go out, explore the world and maybe in time find a new love who will love him and only him for the rest of time. His thoughts flicker to the cure.
He knows Elena doesn't want the cure, what if he would take it? That would solve a lot of problems. Elena and Damon can be together forever if they want to and he gets to live a normal, loving life and he gets to die if he so pleases.
He wouldn't have to live with the guilt or pain or suffering anymore. Turning human didn't really sound all that bad to him right about now, but first, he needed to do everything in his power to save Elena from this evil monster she's becoming because he knows that after everything they've been through, he owes her that.

He walks the stairs to the basement and looks through the bars.
She looks so peaceful, like the Elena he knows and loves but he knows that the moment she opens her eyes it's going to be harsh brown eyes judging him and not the loving amber eyes he knows
"I know you're there Stefan, I can hear your breathing" she slowly opens her eyes and sure enough they're harsh and judgmental
"Good to know you can still single out my breathing" he tries to crack a smile but quickly recovers when she vamp speeds to the bars and tries to strangle him
"Let me out, NOW" she demands.
Stefan just wriggles her hands away from his neck. She's a newbie vamp, did she really think that she would be able to hurt him just like that.
"No can do, Princess. We're not letting you out of our sight until you're perky, bubbly Elena again" he heard Damon come down stairs a minute ago but he had just made his presence known.
Elena turns her head to the other side of the bars and Stefan swears her eyes become even colder if that's possible.
"Damon" she spits, she quickly turns around and positions herself back on the stretcher.
"I'm not in the mood to talk right now guys. My back hurts, my head is killing me and I haven't slept well. Not a good combination" Elena looks at Stefan when she says that and purposefully ignores Damon.
"Well, trying to kill your best friend would kind of do that to you when she retaliates" Damon's voice is accusatory and he doesn't know what to think of that.
"She had it coming" Elena stretches her legs and back and looks around
"What's with you and hurting all your friends. First Caroline, then Bonnie and Stefan just now. Who's next, me?" Damon opens the door a little and throws a blood bag into her line of sight.
"Don't tempt me, Damon. I could easily try and hurt you" She stands up and gets the blood bag and looks up at him while talking.
"It's nice to hear you revere to yourself as a 'friend' and not 'date' or 'boyfriend'. You seriously almost made me puke last night, Damon. Don't ever do that again" Stefan looks at his brother and he sees a serious look of hurt across his face.
He didn't know that happened last night, she hasn't been hurtful towards him the entire night. Apparently Damon had been on the reserving end of Elena's wrath last night.
"Elena, just drink the damn blood bag. Stefan, can you come upstairs for a minute? I need to talk to you"
Stefan looks from Damon to Elena and back to Damon.
"Need to discuss tactics on how to get pure little Elena back?" She spits at Damon and Stefan just doesn't get what's happened to Damon and Elena's relationship to make Elena react so badly towards his brother.
"Elena, seriously. Shut up!" Damon is getting angry now and Stefan knows that Damon getting angry isn't something he needs right now so he takes him by the arm and starts to drag him upstairs.
Before he rounds the corner he hears Elena call for him. He tells Damon he'll be upstairs in a minute and walks back to the bars. He takes a deep breath because whatever is coming out of her mouth is going to probably be a stab towards him now.
"Yes, Elena. What is it?" He tries to act nonchalant and not let her see that she still gets to him.
"Maybe I don't remember Stefan, It was still nice dancing with you last night" she looks up and smiles at him.
For some reason the smile seems genuine, but he doesn't want to dwell on that for long. It's save to say he didn't see that coming. He doesn't know what to say so he turns around and walks upstairs.

Yes, he knows. Saying you're moving on and actually moving on are two completely different things.