This question regarding Liam O'Flaherty's short story "The Sniper" is a subjective one. This is my perception.
We are told that the Republican sniper is something of a fanatic, supported by the fact that he was too excited earlier to eat. By the time he has killed the man in the turret car and the female informer, the reader gets the sense that he is comfortable with his life. He has killed as he was ordered to do, taking out anyone who is a Free Stater or a sympathizer.
The action of the story turns when he is wounded by another sniper. In his quest for self-preservation, he knows that he must be off of the rooftop before the light of day. So he plots to trick the other sniper, by pretending to be killed himself. The plan works and the Republican sniper kills his adversary—uttering "a cry of joy."
However, his pleasure fades when he sees the body of the sniper on the ground below.
He became bitten by remorse.
We can infer that he is not as heartless and cold as he seemed earlier. In fact, he curses himself, the war and everybody.
Knowing he must be gone soon, the Republican sniper climbs down from the roof. He allows that the other sniper was a good shot. Out of curiosity, he goes to the place where the dead man lies. The quote that seems to show how the structure of the text creates surprise is:
He wondered if he knew him. Perhaps he had been in his own company before the split in the army.
The Republican sniper has been portrayed as a solitary figure, alone on the roof. Until now, there have been no indications that the enemy sniper was more than a faceless enemy. O'Flaherty purposely has not given sense that the Republican sniper spends anytime humanizing the other man. He is like a specter, a faceless form attacking from the other rooftop. It is only because O'Flaherty never provides any depth to the other sniper that the reader can arrive unquestioningly at the point that the Republican sniper wonders about his identity. At this point, everything happens quickly, and the structure has been put in place so that the quote above does not foreshadow the upcoming enlightenment found in the story's final line.