Make an ability, give it to the unit
Make a trigger:
Event:
Unit Starts Casting an Ability
Conditions:
Ability equal to X
Actions:
Unit - Make Casting Unit Face (Facing of Casting Unit + 90) over 0.00 seconds
This makes the unit rotate by 90 degrees. If you want to change how much the unit rotates, you can change this. Also, if you want the rotation to make a small, but very significant and great difference in gameplay, change the Pathing Texture of the barricades to Hay Cart (same as Short Fence). This will make them act sort of like a short fence, where they act like more of a rectangle than a square.