You need to add a condition to not count touches on the main menu button when it's invisible. Otherwise when you touch the level 10 button it switches to level 10 and you're now touching the main menu button which brings you back to the start immediately.
Also if you tidy up your events and use families more you could cut the number of events in half (at least).