Been a while since I watched HLV (not one of my favorites!), and now I'm trying to remember why Sherlock went to Magnussen's office. Does he say?
They had used several pieces of canon to reach that point -- he had sweet-talked CAM's employee, saw a woman with a gun threatening CAM. Hmm, in canon, I believe Holmes had gone there in order to ransack CAM's files (and ended up doing exactly that) -- so perhaps that's what Sherlock had in mind? But how did he hope to get away with it, when he was counting on Janine to let him in? Did he expect to sweet-talk her into betraying her boss?
1. In the original story, SH (in disguise as a working man) somehow manages to sweet-talk CAM's housemaid into an engagement as a pretext of getting into the study. Even giving SH credit for great powers of persuasion and personal charm when it serves his ends, it seems a gentleman in the Victorian era could get engaged to a lady who was nearly a complete stranger in a matter of days, with very little passing between them in the way of personal interaction and Christian names not even being employed. The whole 'Janine' ruse was one of Mofftiss's better, more organic Canon nods--an improvement over the original, in fact, though must have been uncomfortable in the extreme for SH to simulate a romantic relationship for what must have been many weeks, if not months.
The scene 'In Hallway Video Monitor With Ring' is one of Benedict's more adorable moments of the entire series. Those puppy-dog eyes are a lethal weapon, instantly pulverizing female resistance of any kind.
2. Sherlock was there to ransack Magnussen's computer files on behalf of Lady Smallwood, his client. Even the Great Detective erred in not realizing that CAM's files were not, in fact, in the physical/digital world in any form, but that CAM had a Mind Palace to rival Sherlock's own. Perhaps even the superior of it, since we know how garbled SH's memories actually got. Stumbling into Assassin Mary was also a complete accident. But this has just occurred to me--S. and J. went into the office together; they see Janine cold-cocked on the floor. So Watson stops in the outer office to tend to her while Sherlock proceeds into CAM's study and finds CAM being held at gunpoint by someone wearing Clair la Lune. Mary's got those wraithlike assassin skills (which being dressed in head-to-toe black helps to emphasize) . . but we are asked to believe that she shot Sherlock and called 999 on her way out and John did not see or hear a thing, just steps away?
3. Yes, I think Sherlock did expect to sweet-talk her into betraying her boss. After all, she'd be so dazzled looking at her new engagement ring that he could probably break into CAM's computer while Janine was blubbing with happiness. The alternative--that he'd strip Janine of her illusions right then and there as to his true purpose in being there and would just overpower her to do what he came for while she cried at his betrayal is also a possibility. After all, he had just admitted to Watson a moment before that he just got engaged for the sole purpose of breaking into this office. He wouldn't have cared about sparing Janine's feelings. On the whole, it was a bit of a mercy that Mary conked her on the head so she didn't have to face this dilemma right away. She got her own back while Sherl was laid up in the hospital and I don't think a single person watching begrudged her that cottage in Sussex or her revenge. Sherl was very, very cruel to her. She could have hurt him a lot more than she did while he was in a vulnerable position (cf. Roman Polanski's 'Bitter Moon') but she treated him better than he deserved. I hope poor, sassy Janine found herself a nice man in Sussex, one who's happy to have a devoted gorgeous Scottish girlfriend. Sherlock Holmes did not deserve her anyway.