If someone is shooting at me, I'd rather stick my fist (with weapon) around a corner, than expose my head or chest.
So naturally the weapon would have a telescoping arm for the purpose.
Dramatically speaking, a shoulder mount such as seen in Predator would probably be the way to go.
A hovering weapon the size of a hand phaser would seem to be beyond TOS technology.
Only in the sense of being difficult to do VFX- or SFX-wise. Otherwise, not only would TOS have been free to establish its level of technology, after which the various spinoffs would have had to comply - but TOS as actually portrayed is fully compatible with hovering, remotely operated things. They have silent and strong antigravs, for example. And while independently intelligent robots seem to be a no-no, waldo technology would be right up the 1960s alley. Heck, they even turned Spock into a waldo once!