Sorry this is running a little late, I had something come up before I could post this earlier.
In case you didn’t notice, the episodes that spanned the gap from Ash’s initial battle with Skyler up until the actual gym battle was an episode arc of sorts. First Ash actually fights Skyler, then he relates about his loss with his rival Ryu, then he is inspired in a new strategy by Brenda’s Pokémon Contest, then he trains as well as captures a new Pokémon to help him further, he trains some more, and finally he wins the gym battle. I wasn’t initially attempting to make an arc like that, it actually sort of just worked out. About the time of the second contest episode, I figured out it could work that way, and decided that I might as well roll with it.