Well Watson broke his vow, and Sherlock was gonna take the bullet but Mary jumped infront of him and saved his life. Even tho he was trying to save Mary's. So if Sherlock could do anything to save Mary he would but the thing is he couldn't, so he precisely kept his vow to save Mary.
13 Things You Need to Know About the New Sherlock Season It only takes a moment, but watching Johns face go from near panic (Sherlock took a gun and is pointing it at the police, some of which are still our friends/ hes snapped and I can barely watch), relief (hes not pointing it at them anymore/ its pointed at me, I can deal with this), realization (oh, hes got a plan), and finally that face that looks like hes popping over to Tescos for milk. ^^^^ This - this explains it all.
I love Molly. She’s so ordinary; and yet she’s not a shallow character. I love this moment because Sherlock has just been outdone by little Molly Hooper, and he just stands there, speechless. I think this is when he finally realizes that she IS his friend. And he looks guilty for not seeing her before, for not admitting to himself that she DOES count.