I absolutely don’t believe that Mary had to shoot Sherlock for any circumstantial reason. I also don’t believe that he, ‘happened’, upon her accidentally. I think Mary were there to kill Sherlock, and it was a trap, through and through.
The question for me, right now, is: why stage this tableau, at all? Why make it seem like she had to shoot him? If Sherlock would die and John would never know? Who is this little play for? The only answer is Magnussen. Magnussen is not and never was her target. He is her audience, her witness,
She could have killed Sherlock a million different ways and different opportunities and she chose this particular scenario to shoot him. One might think that she wants it to look justified, to create an air of an inevitable choice, in a moral sense. But, Magnussen is not one concerned with ethics or morals, he does not need to be impressed by her, you know, moral fibre or whatever. Besides, she knows who she really is, anyway.
Now, if we add the scene where Magnussen visits Sherlock in the hospital we can see that Magnusssen never fell for the way Mary played out the shooting, at all. He’s smart enough to see that Mary wanted to kill Sherlock and leave him as the survivor. I think this is a huge reason why this scene was deleted: it spells out for the audience that Mary was not as she was described by Sherlock when he, John and Mary talk at Baker St after he leaves the hospital.
I think that John, in fact, could have forgiven her if he’d found out about her past. The thing that John cannot forgive is her attempting to kill Sherlock. Mary knows this. That’s why whatever is on the agra drive does not matter to whether John forgives her or not. He does not. Because she shot Sherlock and it is not justifiable by any of the scenarios that we can imagine at Magnussen’s that night.
Magnussen deals in information. Shooting Sherlock in front of him is Mary deliberately giving him inside information. This seems counterintuitive. Isn’t she trying to get back the information he already has on her? Why is she adding to her own file in Magnussen’s mind palace? Because of what Magnussen might do with this information, clearly. She wants Sherlock dead and for Magnussen to know that it was she who did it. And possibly to see John’s reaction, as well,
But, what does it matter if John loves Sherlock if the latter is dead? Is this Mary’s way of explaining to Magnussen why she killed Sherlock? If she did shoot him out of jealousy, then here Magnussen can see for himself what might have motivated her. Once he sees John’s distress, he can possibly conclude this is why Mary shot Sherlock. Even though she may have done so for another reason entirely. Doing this, here, allows Magnussen to piece together a narrative that Mary wants him to believe. And if he controls information and shapes public opinion, this is a very shrewd way to manipulate how her crime is perceived.