i used to be a delivery driver and a mechanic told me that it is actually not good to turn off the engine for short periods of time plus you use as much gas starting the engine back up then you would leaving it running.
If you're a delivery driver and making many stops each day, it's hard on the battery to turn off the engine every time (you generally need to drive the car for 15-20 minutes to replenish the battery after a start). The battery has enough reserve capacity that the occasional short trip is fine, but if you have 20 or more starts each day like a delivery driver would if they shut the engine off every time you'll end up wearing out the battery much faster.
You'd need to leave the engine off for quite some time (perhaps an hour or so) for the oil to drain out of the top end enough to cause any meaningful startup wear, and you'd need to wait longer still for the oil to fully cool and really get back to a state where startup wear is a concern.
The fuel usage argument used to be true with carburetors, but modern EFI is incredibly good and you'll generally use less gas by turning the engine off any time you'll be idling for more than a few seconds (this is why the engine stop function for hybrids yields useful increases in fuel economy).
Back to the OP, the biggest concern I can see about a running car while pumping gas is the car somehow getting into gear and moving without anyone in it. Granted, this would be incredibly rare, but it's still something that could really only happen with the car running (or, at least, it would be exacerbated by the car running).
A less immediately-dangerous issue might be the potential for an opportunist to jump into your car and drive off with it as you're pumping gas. Yes, they could mug you for your keys even if the engine is off, but with the keys in and the engine running it's much easier and less risky for them.
ZV