The situational irony at the heart of “After Twenty Years” is the fact that the patrolling police officer with whom Bob has an extended conversation about his friend Jimmy is, in fact, his friend Jimmy. While readers are not initially aware of this, it becomes clear via a classic O. Henry twist ending in which a different police officer (who has just arrested Bob for criminal charges) gives Bob a note from Jimmy that explains the whole thing, as seen in the following passage:
[Bob] unfolded the little piece of paper handed him. His hand was steady when he began to read, but it trembled a little by the time he had finished. The note was rather short.
“Bob: I was at the appointed place on time. When you struck the match to light your cigar I saw it was the face of the man wanted in Chicago. Somehow I couldn’t do it myself, so I went around and got a plain clothes man to do the job. “JIMMY.”