I'm pretty sure Sherlock didn't administer the gas in that scene, only locked him in and (possible?) administered creepy sound-effects to get John panicking a little, since he thought he had administered the poison in the sugar, and John only coincidentally was exposed to the gas while Sherlock thought he was feeling the effects of the sugar.
no subject