If we don't believe in coincidence then Mary sought out John for a reason.
Mycroft left her there , so he thought she was harmless and likely would protect John and could prove useful/interesting/bait.
I think she wanted to know if Moriarty was really dead , because she had betrayed / informed on criminals connected to him , but then compromised herself by falling for John.
Once Sherlock turned up alive and Magnusson played his hand , everything went wrong for her.
Mycroft let it all play out to his advantage, either Mary would rid him of Magnusson or Sherlock would , and he had plausable deniability.
In the smoking convo Mycroft did tell Sherlock to slay the dragon and Sherlock did tell John to bring his gun, both seemed aware of the possible outcome of taking Magnusson on.
The "here be dragons" comment at the end could easily be a nod to playing the Moriarty alive card.