Sentence (1) actually doesn't make sense to me. It's not the same sort of situation as you started with: "When he coughed" is a single event: He (whoever that was) coughed, and the noise evidently woke the baby. "When she slept" isn't an event.1. When she slept, an earthquake hit.
2. When she was sleeping, an earthquake hit.
Do they have the same meaning? Or does (1) mean "as soon as she fell asleep, an earthquake hit?"