I almost forgot one very important part about this concept. If you tell your character to use their melee weapon, but they can't get close enough, they would have to be something set up so that the game would allow that character to switch to ranged automatically and use it instead so you wouldn't waste a turn.
In other words, let's say you told your fighter to run up and attack a goblin who is 30 ft from you. However, the computer gives orders to that Goblin to retreat 10 ft and shoot. As the round is playing out, the computer determines that the fighter is not going to reach the Goblin. Therefore, it has the fighter pull out her bow and shoot the Goblin instead. If attacked by enemies in initiative order prior to the fighters turn, she still has her shield and sword out. But once she has acted in initiative order, all enemies that attack her after that would do so without her having a shield.
This might require some sort of primary and secondary action cue. Your primary action for the fighter is run forward and attack with sword and shield. The secondary action is to switch to bow and shoot. The second action is only triggered if the first action cannot be done. In this way, you would tell the computer to either have her pull out her bow and shoot or have her use the dash command to reach the Goblin by the end of her turn.