Specifically, the sniper in this story solves the threat to his life through trickery. The main threat to his life (after he has killed the man in the turret) is from the enemy sniper. He tricks the enemy sniper into believing that he is dead.
He does this by putting his cap up on his rifle and sticking it above the parapet. When the enemy shoots it, he lets the rifle fall to the street after letting the enemy see it dangling in his (seemingly dead) hand for a bit. When the enemy gets up (thinking the sniper is dead) the sniper shoots him with a pistol.