As a preliminary note, a good solution to this problem will (as usual) involve talking to your players. Ask them if they think this is even a problem, and if so, what kind. You may find that they enjoy being reckless and don't mind dealing with the consequences, even if that means inaction or even death for their characters. If so, congratulations: you're all set! But if they don't want to be unconscious and bored, read on.
You can try different things to keep them entertained, like having them run NPCs, narrate the combat to make it more epic, or take notes for posterity. If your players are flexible, that may work, and they may even enjoy the change of pace. (Though honestly, in my experience once they're stabilized it's usually a good time for a bio break to get more drinks for everyone or take care of other necessities, which should resolve the situation nicely unless it's a really long fight.)
However, most players are at the table because they want to play their characters. (Not all of them, but most of the standard motivations require being able to influence the game in some capacity, and most of those involve investment in a specific character.) If that's true, then no substitute will ultimately be as satisfying as being in there with your own character, mixing it up.
So if I could back up a bit, I would ask a different question, namely, why is this situation occurring so frequently that you have to ask?
If PC's routinely get KO'd, I suspect one of three things is true: A) your PC's are low level; B) your PC's are employing bad strategies; or C) your encounters are structured in a way that causes a lot of KO's, possibly because you're using Glass Cannons (warning: TVTropes).
A) should resolve itself pretty quickly. B) might resolve itself as your players learn better strategies, but you may need to ask if they want any pointers. If it's C), though, you can fix this by adjusting your tactics, both in building encounters and how you run them. A plan failing because "You didn't even dent her armor!" can be as spooky as one failing because they spotted you and stabbed you. (Of course, if you go too far with defensive enemies, fights can drag on forever, but sometimes people have to be defeated in a particular way that requires a little in-game research or experimentation.)
More importantly: if your boss fights are deadly and/or you've successfully cultivated an atmosphere where they feel deadly, when a PC does drop your players should be scrambling to get them back up so they don't lose the advantage of numbers (not to mention, y'know, keeping them alive). You've said the party doesn't have a ton of healing, but you can influence that by pointing them towards Goodberry and other useful spells and abilities, adding an NPC, or just giving out healing potions as loot (something that's working pretty well for 2 groups I'm in with relatively little healing). If people are watching each other's backs, a PC shouldn't be down for more than a round or so.
If you take the above into consideration, I think you can probably settle into a rhythm where this isn't too much of a problem in the first place.
Yes, if the second Goblin is not within the Reach of the thing making the opportunity attack
It seems a bit weird, however the criteria for triggering an opportunity attack are:
- You are moving out of the reach of a hostile creature
- This movement is from one of your Actions, Bonus Actions, Movement or Reaction
- You have not taken the Disengage action
- You are not Teleporting
For this question we can discount Point 4, as the Goblin Boss can't teleport.
We'll also ignore Disengaging for now.
For Point 2, the movement is by the Goblin Boss' Reaction, which fulfills that criteria
For Point 1, if the swapping with the second Goblin does not cause the Goblin Boss to leave the Reach of any hostile creature, it will not trigger an Opportunity attack. In the diagrams below, the first set of movement will not trigger an opportunity attack, while the second set will.
EG -> EB
B G
EBG -> EGB
E - Enemy;
G - Goblin;
B - Goblin Boss
Note that wherever the second Goblin is moved from, it does not trigger an Opportunity attack from anything as its movement is forced by the Goblin Boss.
As for using Disengage (via Nimble Escape), it only stops OAs for the rest of your Turn, not the entire Round.
So, if someone had Readied an action to hit the Goblin Boss when the Boss did a specific thing, then the Goblin Boss did that thing on the Boss' turn, and in Reaction the Boss used Redirect Attack, that would not trigger an OA, wherever it moved, as it is still the Boss' Turn so Disengage is still in effect. But normally, Disengage would not help for this.
Best Answer
Yes, this is part of the GM's role.
Adjudicating the actions of non-player characters, including (but not limited to) hostile NPCs, is one of the primary jobs of the DM. This is also mentioned in the Combat chapters of the PHB (p. 189) or the Player's Basic Rules (p. 69):
How do I do that?
The DM is basically free to choose whatever he wants the NPCs to do. In your goblin example, the goblins could gang up on the wizard, or just flail wildly at whatever is closest/looks most edible.
However, there are several restrictions as to what you can/should do, because of several reasons, such as your/your groups playstyle, or the shared fiction you create as a role-playing group.
For example, a bunch of four goblins rushing past the fighter and the rogue to gang up on a wizard for no other reason than that he's
wearing a dressobviously a wizard would probably raise eyebrows in a normal game, because it does not fit into a regular goblin group's character (Even though it's a valid tactic for smarter enemies). This is an example of being restricted by fiction. Note that these restrictions never apply "globally", since they are based on the fiction.As to attacking unconscious characters, this brings me to playstyle restrictions. In many groups, this is not done based on mutual agreement. If you as a group like to play for the challenge and like high risk games, then it may become a very valid choice for the goblins (though fictional restrictions can still apply). In this regard, you might want to check out the same page tool, which is designed to (you guessed it) bring everyone to the same page as to what will go on at your table.