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.
Tunnel Fighters don't need any action, reaction, or bonus action to make an opportunity attack RAW
You are correct in your interpretation that, as it is currently written, tunnel fighters do not need any sort of action to take their opportunity attacks that meet the requirements.
You can't cast Booming Blade with any opportunity attack
To cast booming blade you must take the Cast a Spell action. The casting time of 1 action that you point out simply indicates that casting the spell only takes 1 action. And, as part of that action, you can make a melee attack. So there is no way for this spell to interact with either Polearm Fighter or opportunity attacks in general (at least in any way that you describe).
Tunnel Fighter is playtest material and not released or finalized
This might explain why this seems weird and out of place with the rest of 5e's rules. If and when such a feature ever gets released in official published material, then we may see a change in the wording it bring it better in line.
This would be the exact type of issue you would expect to work out in public playtesting. However...
There aren't many (if any) situations in which this seems to matter
I can't think of a single situation in which something interacts with an opportunity attack only if that opportunity attack takes a reaction. So, in all likelihood the fact that no reaction is spent by the tunnel fighter is rather meaningless (aside from the obvious action economy implications for said tunnel fighter).
War Caster does not change anything about this
When a hostile creature’s movement provokes an opportunity attack from you, you can use your reaction to cast a spell at the creature, rather than making an opportunity attack.
War Caster allows you to cast a spell instead of an opportunity
attack. It does not allow you to cast a spell as an opportunity
attack.
No matter what, War Caster specifically says it requires a
reaction to cast the spell.
In the end you are simply using the Cast a Spell action as a reaction which
triggers when an opponent provokes an OA from you. You are trading a
potential OA for the opportunity to cast the spell in this way. But War Caster does not enable the cast of a spell as an opportunity attack, so it does not interact with tunnel fighter in any unusual way.
Best Answer
As Miniman's answer points out, you cannot grapple as an opportunity attack because an opportunity attack does not give you an Attack action. However, your situation doesn't actually call for an opportunity attack. Instead, it sounds like you had readied an action. From Basic Rules page 72:
When you ready an action, you declare that you intend to do something out of your turn in response to something specific happening. For example, you can ready an action by saying "If an enemy comes through that door, I will fire an arrow at them." If an enemy does come through the door, you can then immediately use the readied action and shoot them.
Therefore, if you state on your turn, "I want to grapple the gnome if he tries to get past me," and you have not taken another action on your turn, you would be able to grapple the gnome as he moves past you. If the gnome doesn't try to get by you, the action is wasted. You can also choose to ignore the trigger and take an attack of opportunity as your reaction instead.
Keep in mind that you must declare a Ready action on your turn. Ready actions are actions, like attacks or casting spells. If your turn had already passed when you declared you'd grapple the gnome, your DM would be right in ruling that you can only make an attack. However, if you declared it on your turn, and hadn't already attacked or acted, your DM should have allowed you to grab the gnome.