Event Page Order, Self-Switches, Auto-Run Weirdness?

I have an event where interacting with it turns on self-switch A, which autoruns to turn on the next page and so forth. Each page has a wait time of 20 frames and then a turn off for the last self-switch and a turn on for the next self-switch. Eventually, I mix in a normal switch as well. I cannot, for the life of me, figure out what order this actually works in. It seems to miss turning switches off, for no reason. What am I missing? Originally, I set it up so that one page would turn off all the switches for the pages before that page, but this didn't work at all. I have it now set up to turn off some switches in previous pages and the last page turns off all the switches. This should, theoretically, put the event back at the first page and all the switches off, but it doesn't do this. When I interact with the event again, it jumps around between pages. Here's a long and kind of boring explanation of each page:

page 1: no condition, trigger is set to action button, event is wait 20 frames, turn on self-switch A
page 2: condition is self-switch A is on, trigger is autorun, events is wait 20 frames, turn on self-switch B
page 3: condition is self-switch B is on, trigger is autorun, event is wait 20 frames, turn off self-switch A, turn on self-switch C
page 4: condition is self-switch C is on, trigger is autorun, event is set movement route for player move forward twice, turn off self-switch B, wait 20 frames, turn on switch "close"
page 5: condition is switch "close" is on & self-switch C is on, trigger is autorun, event is wait 20 frames, turn self-switch A on.
page 6: condition is switch "close" is on & self-switch A is on, trigger is autorun, event is wait 20 frames, turn self-switch C off, turn self-switch B on.
page 7: condition is switch "close" is on & self-switch B is on, trigger is autorun, event is wait 20 frames, turn self-switch A off, turn self-switch D on.
page 8: condition is self-switch D is on, trigger is autorun, event is turn off self-switch a, b, c, turn off switch "close", turn off self-switch D.

This works the first time I interact with the event. Each page has a different graphic and it cycles through all of them. However, the next time I interact with the event, it jumps around the graphics instead of displaying them in correct order. I've been messing with this forever - at first it would keep looping and lock up. I've finally gotten it to not do that, but I still have no idea why it isn't turning off all the switches at the end (which is what I'm assuming is happening since when I interact with it again, it jumps around the pages).

[edit: something even stranger is happening. Because the event graphics on each page are fairly similar, I was assuming that the second interaction was causing the event to jump to the page with a barely visible graphic, but I wanted to test that theory so I changed all the graphics to completely different things. Here's where it gets REALLY weird: no page has an invisible graphic, but somehow, on the second interaction, the graphic disappears. I set up the first page to now turn off all the events, which wait times in between, and the second time I interact with the event, it does this while also making the event graphic invisible. I have no idea why that's happening.]

[edit: OK I figured out why it was doing that, and that's my bad. I didn't check the box for direction fix. I'm still unsure why turning off self-switches wasn't working before (what was causing it to loop and play the page with the movement route over and over), but I finally have the event working correctly at least.]
If you still have questions, please post screenshots instead of typing out everything from your event 😉

It's much easier to read that way.
otherwise, why not using a variable to do the event page that counts UP?
reset when needed.

also, event with all 20 pages like some trouble, depending what it does.
If you still have questions, please post screenshots instead of typing out everything from your event 😉

It's much easier to read that way.

I still have no idea why what I was doing originally didn't work, but I got the event to work now so it's all good I guess. I even just tried to recreate the problem and couldn't get it to happen again. I've literally been messing with this for a couple days now. XD

Original thread: https://forums.rpgmakerweb.com/threads/event-page-order-self-switches-auto-run-weirdness.154280/