Stefan hadn't intended to cause Damon any pain by taking Elena's hand- it was purely a source of comfort, and as far as he was concerned, it didn't negate his promise that Damon was going to be his priority from now on.
At Damon's words, he gave Elena a reassuring smile, and her hand a quick squeeze in return. Enough to let her know that he was still her friend again, to let her know that it was just that he didn't want to hurt his brother.
"Ssh, you're not a disappointment," he told his brother, pained to even hear him so low.
He turned as Caroline arrived, looking up at her with eternal gratitude- although he quickly pulled a face of exaggerated disgust as she mentioned kissing him again.
"I'm sorry you had to go through that- you know we're all so grateful to you," he told her, sincerely. It had to work. It would work.