I believe the troops can be at that position and not worry about the vacuum of space because of the magnetic shielding. When the Falcon first comes into the DS, there's a voice announcement about closing the magnetic shield. Later, when escaping, there isn't any visible door in the hanger, and the Falcon just flys out... even though there are still stormtroopers firing away. If there wasn't a shield, those troopers would get sucked out into space (I don't think their armor works as a zero-g outfit).
My thought about those two guys is... just *what* exactly are they doing? I mean, there's an entire control room to fire the darn thing, so why do you need to extra guys right by the barrel of the gun (and since there are a number of lasers, that all combine to become one big laser, there must be a bunch of guys spread about the station)? There sole purpose seems to be to look in the barrel, then cover themselves with their arms after it fires.
*DS trooper sticks head in superlaser barrel*
"Hmm, don't see anything yet-- THERE IT IS! DUCK!"
*DS trooper leans away from 20-foot diameter laser beam*
"Whoo! That was close... good thing I took a step to the side."
~SDC~