Of course in a show that's dedicated to advertising a sobriety program whose effectiveness is mysterious and controversial, I wouldn't put it past the writers if they get things wrong. The idea that it might be a ploy seems silly to me, but it is not mutually exclusive with Holmes being on the verge of relapse. The heroin might be a "ploy" to get Watson's attention without pretending in the least. Or he might intend to ritually destroy it in front of her and make a speech how he will work to make their collaboration work even with her moving out.
The scene was unambiguous though, I think it's pretty clear what the heroin there was intended
to stand for, so far nothing suggests it is anything else, and anything (with the possible exception of him throwing it out) is a bit far-fetched. It is strange though, the transition to him going to MI6 was a bit abrupt. It seems to be what you people suggest – he clearly believes that he needs MI6 to not relapse, but still, the connection between the scenes leaves something open to the imagination.
Since this heroin arc is the first (?) time the show has shown Sherlock admitting to himself and the audience that openly he is close to relapse, for a second there I thought this might be about a case. But that's ridiculous, especially for a season cliffhanger, and especially with the suggestions earlier in the season. Still, that doesn't mean we can't debate it as a possibility! (Especially if it involves aliens. Then we definitely should.)