its easy to prevent...
when the boat is at its farthest point of the swing and starting back, toss out another anchor.... pay out the rode until the boat is about halfway to the other side of its swing radius and set down on the rode so the anchor digs in.......
now, pull in some of the rode before snubbing it down so you are off to one side a bit and not directly down wind/current of your bower. with your boat, depending on its design and loading, you may have to experiment whether cleating it at the stern or the bow works best for you, but I find cleating at the stern works great.
what this will do is hold the boat sprung off to one side so it cant get up and momentum to start its swinging/anchor dance. you dont need much scope for this to work, and it even works in shifty winds.