O. Henry loved irony, and used it often in his stories, especially in throwing in his famous surprise endings. Irony sometimes refers to the concept that something that is the opposite of what is expected. For example, I am an English teacher, and it would be ironic if I was a horrible grammarian. You wouldn't expect that; because I teach English, you would expect me to know and use grammar correctly. In "After Twenty Years," there are several unexpected twists to the storyline. We meet Bob, who by all indications seems to be a very nice guy who wants to meet up with his old friend. The police officer, polite and fastidious, seems to be only a professional man conversing with a stranger. All of these assumptions end up being the opposite of what we would have expected. Bob is really a wanted criminal, on the run from the law. The police officer really does know the stranger, and isn't merely politely conversing, but confirming his suspicions about the nature of the man waiting on the street.
We learn of all of these ironies in the characters presented at the end of the story, when the police officer turns out to be Bob's good friend, Jimmy. He knew Bob all along, and was just pretending to be an ignorant inquirer. We learn that Bob, the seemingly harmless man with a fondness for old friends, is a dangerous criminal. The largest instance of irony occurs when Jimmy turns in his friend; earlier, Bob had led us to believe that Jimmy was "the truest, staunchest chap in the world." According to Bob, Jimmy's defining trait as a friend was that he was loyal, and he didn't doubt for one second that he'd show up, keeping his word. This makes us think that Jimmy is a great guy who would never betray a friend. Although Jimmy does show up, he unexpectedly betrays his good friend--he put his loyalty to work above his loyalty to his old pal. The irony exists in the fact that Bob's expectations of Jimmy's kindness and friendship were a bit overrated.
I hope that those thoughts helped; good luck!