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?
Turns out my previous answer was wrong. Insomnia activates immediately after the Pokemon falls asleep, so mold breaker can't make an insomnia Pokemon sleep when the battle is ending.
Also a Pokemon will wake up if it gains insomnia by skill swap.