"3- When I was watching TV, the electricity went off."
Grammatically, it sounds ok, but logically strange. You stopped watching TV when the electricity went off. Here, the interruption coincides with the end of a continuous action. In contrast, when I was eating breakfast, the telephone rang / my friend came to visit. The action could still continue.
In practical use, I would say, "I was watching TV
until the electricity went off."
"4- While the electricity went off, I was studying Organic Chemistry."
Again, we have a logic problem. Electricity going off is usually instant, so revert to sentence 3's order "I was..." -> "While I was studying Organic Chemistry, the electricity went off". It is possible you continued to study with either a candle, flashlight, or maybe it was sunny outside and you sat near a window.