I think finally being able to work with Lestrade on police cases is what actually got Sherlock to stop taking the drugs. I also personally like to imagine that Mycroft would have had a hand in this. He certainly still comes around to give Sherlock cases when all is quiet on the police front. (x)