Right, can everyone stop posting on this thread, because all these theories are making my head spin! Instead of putting it out of my mind, I'm thinking about it more and more, and coming to increasingly bizarre conclusions!


Seriously, though, I rewatched the episode last night, this time with the deliberate preconception that Sherlock knew exactly what was happening from the start, and was one step ahead of Moriarty, instead of one step behind.
Even then, it still seemed to me that it came as a shock to him that the code was a fake. And Moriarty's suicide was also a shock, seemingly.
Points I noted -
It was out of character for Sherlock to phone John rather than text - still, it was an unusual situation.
John couldn't actually see it was Sherlock on the roof - just a silhouette - and we only see someone jumping from the back. Was it Sherlock? (Perhaps Molly volunteered to jump? No, perhaps not

)
Were the red seals significant? I didn't get a close look at them. Seems a bit odd to use a seal nowadays. (I expect to get an e-mail from Moffat for this one - I'm sure no one else has mentioned them

)
Did Sherlock deliberately shake the assassins hand to get him shot? If he did know what was happening he might have - it seems out of character to me that he would have shook his hand.
It seems odd that Sherlock didn't check that Moriarty was dead - especially if he were planning his own fake death. Surely he would be more suspicious?
And I am sure the IOU/ "I am you" stuff is very signifiant.
So I still have loads of questions but no answers. Is Moffat open to bribes, do you think? Or perhaps I could ask him round for tea and administer a truth drug - oh, hang on - did Sherlock....? no, probably not.