Can the spell "Command" be used to cause unwitting damage?
RAW: Yes, you can, IF that damage is unbeknownst to the target (and in most cases the caster as well). You could not tell the target to walk off a cliff, jump into the spike pit, or smash its face into your Paladin's Warhammer. You could however tell the target to walk down a hallway you suspect but are not certain may contain traps. Why? Because it wouldn't be "directly harmful to it", it would be potentially indirectly harmful to it. What if it doesn't trigger any of the traps you aren't even sure are (and may not even be) down there? So no, it could not be used as a foolproof trap detector because unless the GM tells you and you (your character) becomes aware there are traps in said hallway, the spell would not fail. Let's say you poisoned one of their 5 rations and then told them to eat one? You can't be sure which one the target will eat, so it's still indirect.
As for the in-universe thought process? You are exactly correct. Self preservation would cause the magical command to fail, to cease functioning, to not take effect. If the target is unaware that it needs preserve its own life from something that might occur as a result of following the given command, then there would be no need for self preservation, and thus it would follow your command.
I don't see any problem with your house rule, but I'm not sure it's really applicable. Part of the problem is terminology--there's a difference between a round and an action or "turn."
In any round, people take their action according to initiative. If my mage character is fighting an orc, and I win initiative, I get to act first in the round: my action is my turn. Suppose on Round 1 of the combat, I try to hit him with my dagger and miss. He then takes his turn and tries to hit me with his weapon--that's his turn.
For Round 2, I decide combat just isn't my style and cast Command, telling the orc "Freeze!" He hasn't had his turn yet--so if he fails his Wisdom save, when his initiative comes up, that is "on his next turn." He loses his action that round. So the rule has the effect that you want, at least as far as that goes.
I'm not finding anything in RAW one way or another, but it seems to me that any action that the orc could take, including fleeing combat, would be covered by that Command as long as he failed the Wisdom save.
In addition, to my eyes the Opportunity aspect is a gap in RAW.
The Command spell has other examples can effectively put the target "out of combat": for instance, "Drop" will make him drop his weapon, "Grovel" will make him fall on the floor. But as written, the target would be able to take a reaction that round, and then freeze, drop, or grovel the next round.
To my mind, that makes no sense, so I agree with you that the rule change is a good one. If I were GM, I would write that rule change so that if the target fails their Wisdom save, they cannot take a reaction until their next turn after they have performed the Commanded action.
This does not unbalance the game, so long as you remember that enemy casters can also use this spell, and use it to the party's disadvantage.
Best Answer
The spell is almost entirely up to the GM; but it does not last longer than 1 round
Much of the spell is left up to the GM's interpretation:
What any given word that is not one of the five listed does (Approach, Drop, Flee, Grovel, Halt) is up to the GM. "Doff" is not listed, so all of its effects will vary from table to table.
That said, the spell does have a duration of "1 Round" from which we can conclude that its magic does not persist beyond the first round where it takes effect. The rules on Duration state:
The spell has no lasting effects for commands that may take a long time to perform. To manipulate somebody's actions across multiple turns you will need a different kind of spell such as suggestion or dominate monster.