The only way to prevent this is to never set up a situation in which it will happen. Don't shuffle pages in a way that they will swap sides or change the page count by any number not divisible by 2. Or take a closer look at what you have on the master page. If it's being overridden there's apretty good chance, in my opinion, that it doesn't really belong on the master, but it's not 100% absolute.
Thank you Peter. Tho I didn't want to believe that would be the answer. I mean, as has been my case, what happens when the client decides they want to add a page near the beginning. Add a page anywhere come to that... in twos or not at all is what you're saying. Surely this is an expected occurence and there are ways to allow it. What I have on the Master page is pretty basic things like page numbers, running heads and empty linked columns... in fact that's it. It's as basic as a Master can be.
Running heads and page numbers should not be a problem since they normally are not overridden. Master text frames, though....
Which version of ID? I've stopped using master text frames except in two types of situation: I need parallel threaded stories, or the layout uses frames that cannot be matched to margin and column guides.
Prior to the introduction of Smart Text Reflow and the Primary Text Frame in CS6 there was no reason to add text frames to the master page just to be able to place text and have it auto-flow. ID will always add new frames and pages as required when you autoflow, and these will conform to the margin and columns guides that you've set up. Enabling Layout Adjustment prior to a change that would swap pages left and right would ensure that these frames remain snapped to the guides. This kind of auto-flow is achieved by holding the Shift key when placing.
With the advent of improved epub features (that I don't use) the regular Master Text Frame option was replaced with the "Primary Text Frame" on the master page. Used in conjunction with Smart Text Reflow, new frames and pages are added automatically when you click to place the text without holding the Shift key. It is my understanding that these frames do not reproduce inappropriately when you have side switching, but it's a feature I haven't played with.