(sorry for the long post!)
Either or both of those sound fine to me. I think it's just DM's call: whatever you need for the scenario.
Personally, I don't see any harm in giving mindless constructs fairly broad and sophisticated behaviors, just so long as that behavior doesn't stray too far from it's intended purpose, and isn't much more clever than an ant when acting autonomously.
So if it's guarding an ancient dwarven crypt, it seems reasonable that it's last command might have been "guard against anyone but dwarves who enter here." Can it be fooled by simple or magical disguises? Up to you, whatever works for the adventure. And if it can be overrridden or controlled somehow, it seems believable that it could be easily commanded to halt, or raise that gate, or turn its axe on a specific dwarf, or anything else straightforward and similarly guard-related-- unless there's a nifty in-game reason to forbid one of those actions, for instance because it responds only to a certain priesthood, is damaged, is specifically programmed not to do something, or whatnot.
Where I'd personally draw the line is probably at issuing compeltely unrelated commands: to "fetch water and fill up those troughs" or "escort the princess back to the entrance" or "pick the goldpieces out of this pile of trash", or the like. Those sorts of things fall well outside it's purpose of "guard the crypt". Of course, with some time and cash, the construct could presumably be re-programmed or upgraded by someone with the right knowledge. Why not, eh?
Also, from a metagame perspective: the PCs likely won't interact with a particular construct for very long, so it's behavior doesn't need to be too set-in-stone, unless it ends up a "pet" or if there are very many identical ones encountered.