Once John, who while "never the most luminous of people, but as a conductor of light is unbeatable," triggers Sherlock to connect Moriarty's rhythmic finger-tapping in the flat with the code, Sherlock is ready for the final confrontation. He knows what he wants and knows how to get it. He plans to survive and is aware he may not. He hopes he will not have to take the fall, in any sense of the word.
Sherlock wants a confession, a recorded confession from Moriarty. He wants James to believe he is the victor, knows he'll want to brag, want "... appreciation, applause, at long last a spotlight..." The frailty of genius is, it needs an audience. When Moriarty succeeds, he'll have no one even close to his intellect who can appreciate his genius. It's not a challenge to get him to explain.
|No lack of electronics on the roof.|
"I have woven my net round him until now it is all ready to close ... and the professor, with all the principal members of his gang, will be in the hands of the police...".. Sherlock needs to make sure all of Moriarty's henchman are identified and neutralized. Doyle's Sherlock had to disappear for a while until all was ready. Our Sherlock is hoping he won't have to disappear, to make the dangerous leap and play out a cruel game against his friends. But he won't know until he's on the roof.
Sherlock gets the confession easily. James explains how he committed the crimes, that he sent people after Sherlock, that the computer code doesn't exist, that "the point of this" is to have Sherlock die in disgrace. Now Sherlock is done. Except for finding out exactly how James is going to make him jump. Then Moriarty confesses to attempted murder, he has set it up so that three people will die if Sherlock doesn't and he isn't going to call off the order. This time, there will be no acquittal.
The Most Dangerous Moment
Moriarty only has him in check, and Sherlock finds an escape square. "I don't have to die, as long as I've got you." Once Moriarty is convinced that Sherlock will go to any lengths to get the information that will abort the assassins' mission, his path is clear: James finally gets to die. He wanted to die before, to take Sherlock with him, he wanted to die by the pool. But he owes Sherlock, he has a debt to repay before he can leave his tedious existence. His only distraction will be gone, dead by his own hand. Life unbearable again. So he dies, confident that Sherlock's must, ineluctably, plunge to his death.
|Freaking out or giving signal?|
Certainly Sherlock thought Moriarty would voluntarily call off the killers rather than be tortured and do it, anyway. Moriarty would be arrested, Sherlock's friends saved, his reputation restored and he wouldn't have to risk his life falling from the roof of Saint Bart's.
Leaping away from Moriarty can be less horror at his act, than making sure there is a clear view for all that James pulled the trigger himself. Part of Sherlock's anxiety reaction afterwards could be theater for anyone watching the roof who is not Mycroft, but include his natural reaction to the situation: Now he has to jump. And his response disguises the cue he needs to give to Mycroft's observers, that all is in place and the leap is imminent.
Sherlock is out of choices and out of time. John will be back at any moment and he has to witness Sherlock's death. Sherlock's final task, before what may be his last act on earth in the deathly fall with a cobbled-together survival plan that can easily fail, is to stand on the edge and convince the stalwart John Watson he is and has always been a fraud. Then he must fall, and prove to John he is a coward.
"Love is a much more vicious motivator."