When a sleeping Pokémon gains Insomnia via Worry Seed or Skill Swap, it will wake up, won't it? So even if Mold Break negates Insomnia, would Insomnia reactivate after the battle and cure the Pokémon?
Unfortunately, Gligurr's answer is incorrect. Mold Breaker ignores the effects of Abilities that could potentially affect the effects (no pun intended) of a move that its user executes. Bulbapedia says that it does break through Insomnia. Types and abilities that grant immunities to status effects (major or minor) only provide immunity upon inflicting. This is why a poisoned Pineco will evolve into a poisoned Foretress. This is also why it's possible to have an Insomnia Pokemon be asleep outside of battle.