All of these are grammatical, but they mean different things. It is very similar to the case without the "but":
I looked vs. I was looking.
Do you get this difference?
EDIT
Given your response:
Yes "I waved to Helen, but she wasn't looking" is grammatical, so is "I waved to Helen, but she didn't look". They are slightly different in meaning. The former means she was looking at something else, before, during and after I waved. The latter means that my waving didn't attract her attention.
The basic idea of the past continuous is to describe an action that is ongoing and incomplete, usually an ongoing action that is interrupted by another action (which would be in simple past):
While something was happening, something else happened.
For example, this would be entirely correct:
The dentist was still working with another patient, so I sat in the waiting room.
This is a little unclear, because you presumably kept sitting after the point in time described, so the sitting could be thought of as incomplete. But the continuous activity provides an ongoing context for the simple activity; it encompasses or encloses the simple activity. For example, we could also say this:
I was still driving to the dentist's office at the time of my appointment, so the dentist worked with another patient.
Now, we could simplify this a bit by changing the simple behaviors so that they don't imply ongoing activity:
The dentist was working on another patient, so I left.
I was sitting and reading in the waiting room when the dentist came in and told me she was ready to see me.
There are a few usages that might seem a bit different, but are really the same:
I was planning to go out to a party but I decided to stay home and watch a movie instead.
I was wondering if you might be able to lend me a dollar.
In the first case, the planning is ongoing, and interrupted by the decision to stay home. In the second case, the wondering is still ongoing at the point of asking, so it is more grammatically correct to use the present perfect continuous ("I have been wondering if you might be able to lend me a dollar"), but idiomatically we use the past continuous in this situation.
Best Answer
For both example sentences, I agree with your book that "went" is correct and "was going" is incorrect. But why?
First, past continuous events aren't the main idea of the sentence. Rather, they provide the context for events in the simple past.
Second, if a simple past event happens "while" a past continuous event is happening, it always means the simple past event only happens after the past continuous event has started.
In the first example sentence, with "was going", it would mean that you left your parents while you were going, as in, you left after you had already left. This is impossible.
In the second example sentence, if both clauses were in the past continuous, there would be no simple past story, so the sentence would be about nothing other than describing a scene, which might be the context for some other simple past clause. This sentence appears to be about what Meg did, so it should be in the simple past.