By the time the sniper laughs, he has endured a great deal of tension throughout the narrative and even before the story began, going through a series of traumatic experiences and emotions. He has been wounded and severely weakened both by his wound "and the long summer day of fasting and watching on the roof." Now, he has just enjoyed a sudden and unlikely triumph, killing his man and watching him fall from the roof. His immediate response to the death he has caused is revulsion and remorse, and he throws down his gun, which promptly goes off, nearly killing him. The shock of this sudden return to danger steadies his nerves, and he laughs.
The sniper's laugh is partly a release of tension. His proximity to death for so long has had a destabilizing effect on his mind. His laughter is also a recognition of the irony of the situation. He has been in danger for a long time, is at last relatively safe, and his reaction to this newfound safety is to act in such a foolish way that he nearly kills himself. Although he has yet to encounter the story's final irony, even at this stage, the sniper sees the absurdity of the conflict and his own role in and reactions to it.