He finally realised what it means, originally mistaking that Scott was telling him that he was the one going to be killed, but he realises that Scott is the person going to kill John Trelawny.
The passage describes a character's realization about the true nature of a situation. Initially, he thought Scott was talking about him being killed, but then realizes it's actually Scott who intends to kill someone else, John Trelawny.