Yes, it works for melee. But no, it doesn't work for shooting weapons. From my (and Dioxine's) observation, if an enemy has such a weapon, they will not act but sort of "go into overwatch" - wait for the player to approach them. And if they get a reaction shot, they don't shoot but your movement is interrupted anyway.