Spoilers, natch.
[[MORE]]At Appledore, it was only the two of them, CAM, and John’s gun in his pocket. If Sherlock had not asked John to let CAM go ahead and do his creepy-tastic thing, this could have gone a few ways.
1: John could have refused, and CAM might have just gotten bored and booted them out.
Result: Total and abject failure to accomplish any of their goals, leaving all of them under CAM’s thumb. (Though as skarabrae mentioned in one of her metas: they might’ve been able to find another way later, if they had waited.)
2: If John had refused, CAM might have ‘pulled the trigger’ and done something like drop a note to one of Mary’s enemies, manifesting his threat and demonstrating his control over them.
Result: Abject failure AND an angry assassin with John’s home address.
3: If John had refused, CAM might’ve come up with something worse to make them do. Possibly he would’ve distracted himself with Sherlock, which would have made it more difficult for Sherlock to grab the gun and shoot him when the time came.
Result: Higher risk of abject failure AND an angry CAM.
4: John might have shot CAM himself.
5: Sherlock could’ve shot CAM earlier, with John’s gun.
Results for 4 and 5 are the same: the cops show up on the scene moments later, with the cooling corpse of a media magnate and two possible suspects, one of whom owned the murder weapon. One or the other or both of them would have been arrested and probably gone to prison for murder—and if the full truth had come out, the UK government would probably have crushed all of them for playing pop-goes-the-weasel with Mycroft’s classified documents.
In the event, Sherlock’s choice was simply to wait and make sure there were eyewitnesses so that they would know which person to arrest. To accomplish this, he was forced to allow CAM to distract himself in whatever way the slimy bastard chose until the police arrived. Hence, he requested John to play along—and John trusted him, because when Sherlock makes requests like that it generally means he has a plan.
As an aside, it delights me to no end that John’s face while CAM was flicking him was not the hardassed “I’m going to shoot you in a moment’ face he gave Mycroft way back in the first episode, but his patient “I’m putting up with this because you’re an idiot and I know something you don’t” face—although it was moving toward the dangerous face there at the end. I don’t think Sherlock had much time left before John would’ve lost tolerance and taken care of things himself (and that might be why Sherlock was starting to sound a bit antsy there at the end, with the added apologies and whatnot).
Sherlock also may have taken a gamble that since it was him, Mycroft would go out of his way to pull strings and arrange for the best possible conclusion that he could.
And he did. Sherlock did NOT go to prison. I don’t think he even stood trial; it looks like Mycroft shouted “OFFICIAL SECRETS!” and then swept his brother up into the blackened pit that is the MoD (in the UK, the doings of Special Forces and other clandestine branches of the MoD is much more obscured than in the US, and even in the US it’s not like they splash that stuff all over the papers). Sherlock may be a murderer, but he seems not to be a convict.