No.
You have to choose to Power Attack on your turn as part of your attack action:
On your action, before making attack rolls for a round...
And the AoO rules say...
Attack of Opportunity
You threaten all squares into which you can make a melee attack, even when it is not your action.
Attacks of opportunity are special attacks -- they are not a type of action.
When it is your action (your turn), you can choose to make a Power Attack, before you make your attack rolls. You then get the Power Attack bonus for all melee attacks until the beginning of your next turn. This means you do (and must) apply your Power Attack bonus to an attack of opportunity, but only for an AoO made after the action in which you made a Power Attack and before your next turn.
Since it may not be obvious based on the comments I'm getting, the "on your action" language is almost definitely an accidental hold-over from the 3e rules, as mentioned in KRyan's answer. It is not intended to mean on any action, but specifically on your turn.
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
No, Spiritual Weapon can't make Opportunity Attacks.
Spiritual Weapon is a spell cast as a Bonus Action, that then allows you to use a Bonus Action on subsequent turns to make additional attacks, as below:
Since Opportunity Attacks rely on using a Reaction, there's no provision given by the rules for this to happen with this spell.
That said, as with almost everything else in D&D, your DM may rule that it's ok, and that'd probably be fine in this case.
Jeremy Crawford also agrees and says that spiritual weapon is not intended to be able to make opportunity attacks in this Tweet: