I think it also needs to be mentioned that those Dark Elf "guns" were CRAZY powerful relative to everything else we've seen in the MCU.
Remember the fight between Thor and Iron Man in The Avengers? He took several hits from Iron Man's repulsor blasts to the face, and it didn't even knock him down. Those repulsors have been shown to destroy Chitauri sleds and the Jericho missile system, let alone Extremis soldiers and Hammer Drones, in one hit. And Thor didn't even fall down.
Asgardians are tough as hell.
Plus, not many people mention it, but Asgardian shields did block those Dark Elf energy blasts. Watch closely and you'll see them shimmer blue and dissipate the energy. The blasts only killed the soldiers when they hit them straight-on, missing the shields.
I think this has less to do with "projectile vs melee," and more to do with the Dark Elves being way tougher than the average enemy of an Asgardian solder. When you're tough enough to take most weapons that most enemies can throw at you, without even the benefit of armor, it opens the door to using more "ceremonial" or traditional weapons being used at most times, because the need for something better isn't really there. But then when an ancient evil returns with a vengeance, it can catch you off-guard.
So basically, they use swords because usually that's all they need. But the Dark Elves were an uncommonly powerful enemy.