What a fantastic question! Sherlock actually tells us exactly what his intentions are here. First off, let’s look at the moment he asked Molly to join him.
SHERLOCK: “Molly, would you like to…”
TOGETHER: “Solve crimes?” “Have dinner?”
Irene Adler reinforced the idea of dinner as a metaphor for sex back in ASiB. And Sherlock reinforced the idea that crime solving is the equivalent of dating for him and John before that, in TBB:
SHERLOCK: “A date?”
JOHN: “It’s where two people who like each other go out and have fun?”
SHERLOCK: “That’s what I was suggesting!”
And that’s exactly what he’s suggesting here, metaphorically. John’s pissed off at him, so Sherlock’s trying on his version of dating with someone else. He confirms this later on the case with Lestrade.
LESTRADE: “This gonna be your new arrangement, is it?”
SHERLOCK: “Just giving it a go.”
LESTRADE: “So John?”
SHERLOCK: “Not really in the picture anymore.”
He’s giving it a go. Which is pretty great, honestly. Reichenbach taught Sherlock a lot of things. In the scene before this with Mycroft, Sherlock proudly acknowledges that he has friends now. John might be “out of the picture” (at the moment), but Sherlock still wants companionship. This is completely at odds with the Sherlock we met in the pilot, He’s growing and learning to trust and care about other people, and it’s fantastic.
Unfortunately, the “date” doesn’t go all that well.
Because Sherlock is so preoccupied with John, so thrown by the fact that John is supposed to be his crime solving partner and yet isn’t here, that he’s hearing John’s voice in his head. It’s funny, but it’s seriously sad, too – Sherlock even responds to him, shut up John, and smacks his head in agitation.
Ever try dating too soon after a break-up? It usually sucks.
Moving on to the part you asked about, after the crime solving portion of the “date.” This is pretty awesome because it perfectly mirrors John and Sherlock’s “date” in ASiP, at Angelo’s. Here’s a comparison of dialogue: Bold for TEH, italics for ASiP:
SHERLOCK: Fancy some chips?
SHERLOCK: I know a fantastic fish shop just off the Marylebone Road. The owner always gives me extra portions.
ANGELO: Anything on the menu, whatever you want, free. On the house, for you and your date.
John: I’m not his date.
MOLLY: Did you get him off a murder charge?
ANGELO: This man got me off a murder charge.
SHERLOCK: No – I helped him put up some shelves.
SHERLOCK: Three years ago I successfully proved to Lestrade at the time of a particularly vicious triple murder that Angelo was in a completely different part of town, house-breaking.
ANGELO: He cleared my name.
SHERLOCK: I cleared it a bit.
So the point here is driven home. Sherlock is giving it a go, trying this “dating” thing with someone who isn’t John – a good old evening of crime solving topped off with dinner.
(Just a note: This is, in both cases, a metaphor. I’m pretty sure the only time a character on this show who has ever suggested eating dinner to genuinely imply sex was Irene.)
Sherlock knows, when he asks Molly about dinner, what her answer will be. She’s confused (understandably so!) about what this whole crime solving thing was about, this “date.”
MOLLY: What was today about?
SHERLOCK: Saying thank you.
MOLLY: For what?
SHERLOCK: Everything you did for me.
MOLLY: It’s okay. It was my pleasure.
SHERLOCK: No, I mean it.
MOLLY: I don’t mean “pleasure”. I mean, I didn’t mind. I wanted to.
SHERLOCK: Moriarty slipped up. He made a mistake. Because the one person he thought didn’t matter at all to me was the one person that mattered the most. You made it all possible.
This is lovely. Sherlock is, frankly, a complete misogynist most of the time. He treats women terribly. Even in the case of Irene, she’s like the exception to her entire gender – THE woman. And no woman takes the brunt of Sherlock’s awful attitude towards women more than Molly.
But here, at last, Sherlock has realized that Molly is a person he can trust, someone he can rely on. In fact, it’s more than that: Sherlock has realized that Moriarty’s mistake was nearly his own mistake as well. Molly tells Sherlock in TRF that she “doesn’t count,” and it has an impact on him. Molly does, of course, count. She’s very important to him. And that’s why his entire scheme worked. He realized this, but Moriarty never did. And so Molly was the one person that mattered most, the person who made Sherlock’s survival possible. Because she did matter to Sherlock, and Jim had no idea.
SHERLOCK: But you can’t do this again, can you?
Another sign of growth is how Sherlock handles Molly’s obvious crush on him now. He knew about it in previous seasons, and coldly used it to his advantage. Here, he is far kinder, and he realizes she is engaged and is trying to move on from that crush. Since it’s not as if she only just slipped her ring on, Sherlock probably noticed it at the beginning of the “date.” You know, back when John was yapping away in his head and driving him to the point of distraction. Sherlock knew this “new arrangement” wasn’t working, but he gave it a go, and that’s something.