I see no reason whatsoever to do it while running. You're asking for trouble, as you might inadvertently dump a load of water into an intake and lock the motor. Bad idea.
I'd already got degreaser everywhere, so it just needed washing off. Not going to harm the motor, at any rate. Only if you set about asking for trouble do you get it (i.e. point-blank blasting a fuse block or control module for minutes on end).
*Edit*
And, of course, if you're running the engine it will likely be hot - which is the worst possible condition, if you're going to dump cold/colder water on it. Bad idea. You don't need it running to 'dry' components, they'll dry naturally - and most electronic components are already shielded against moisture and water ingress.
Air intake on most modern cars isn't inside the engine bay, and do you avoid driving in the rain in case the engine gets covered in spray?