What a mess! And a mess that could have been avoided if the umpire did what he was supposed to do and inspect the line-up given to him before the game to make sure it contains the right number of players. Once handed to the umpire the line-up is official for that game. Many umpires will accept the line-up, inspect it, then have the coach take one more look at it to make any corrections before accepting it as "official".
I know that when I go through that routine at a pre-game conference, a lot of coaches will look at me like, "Why is he wasting our time with that?", but it is how we're supposed to do it and if it prevents a mix-up later in the game it is worth the extra few seconds it takes.
I've only had one thing like this come up all year. In an ASA game, a coach handed me a line-up with a "Designated Hitter" listed! I explained to him that ASA does not use a DH and he did have the option of using a DP/FLEX. So he changed his line-up to include a DP, only this time he had only nine players listed! I explained again how the DP/FLEX needed to be listed and he changed his line-up again. It took a minute or two to sort out, but it would have been a bigger nightmare to sort out once the game had started.
Sometimes, something like this will slip by, for whatever reason. It just gets a lot trickier to sort it out during the game than if you fix it before hand.
Whichever player's name was listed after the #7 seven batter was due to lead off the inning. If the official line-up only had eight players listed, that would be the last player listed (batter #9, but technically she is batter #8 since there were only 8 listed).
When batter #8 (who was not listed on the line-up) entered the batter's box she was an unreported substitution for #9 (who was the scheduled batter). This is a substitution because it involves a player not in the starting line-up taking the place of a starter.
Since this was discovered after a pitch was thrown, and before the unreported sub reached base, there is no penalty. The unreported sub is now officially in the game. #9 has left the game. She could use her one re-entry to re-enter in the #8 spot of the batting order at any point.
Now we have to deal with the next spot in the line-up, which is the "vacant" #9 spot.
Batter #9 cannot bat there- she was technically in the #8 spot on the original line-up and is tied to that position. The only other option is to place the one remaining bench player/substitute in the #9 hole.
The end result is that the number eight hole is occupied by player #8 (who has come off the bench and replaced player #9) and the nine hole is occupied by the other bench player. There is no batting out of order penalty to be enforced, because this was corrected by the unreported substitution rules before it ever got to that point. No player has actually batted in a spot other than the one they were legally occupying in the line-up.
The only real penalty is that if the coach wants to get player #9 into the game again (she must enter in the eigth spot of the line-up), he has burned her one remaining re-entry. He has also removed any flexibility from his line-up/bench for the rest of the game, since all of his players are now locked into one of the nine original spots. If he has a player become injured, he has no substitute to replace her and would be forced to take an automatic out in that batting spot under the short-handed rule. If one of his players happened to be ejected, the game would become a forfeit because there is no available sub and you cannot continue short-handed due to an ejection.
Hope all that makes sense!