Complex sentence: When the three go to visit a head-exchanging witch named Mombi (who looks just like Nurse Wilson), for more information, they end up imprisoned, and meet Jack Pumpkinhead, a man made of tree limbs with a pumpkin for a head.
Split into simpler sentences: When the three go to visit a head-exchanging witch named Mombi (who looks just like Nurse Wilson) for more information, they end up imprisoned. While imprisoned, Dorothy, Billina, and Tik-Tok meet Jack Pumpkinhead, a man made of tree limbs with a pumpkin for a head.