+0
1. I was just going when he came in.

2. When he came in, I was just going.

3. I was cooking when she knocked the door.

4. When she knocked the door, I was cooking.

5. She had just finished dressing when her guests arrived.

6. When her guests arrived, she had just finished dressing.

7. He was still smiling when the door opened and his wife came in.

8. When the door opened and his wife came in, he was still smiling.

Which of the above sentences is not acceptable?
Comments  
They all seem fine to me; the pairs are essentially synonymous, though the focus lies toward the end of the sentences.

Small point: knocked on the door

1. What is the force that causes the moon to move about the earth? Newton said the answer came to him while he was sitting in a garden. He was thinking about this question when an apple fell to the ground.

2. What is the force that causes the moon to move about the earth? Newton said the answer came to him while he was sitting in a garden. When an apple fell to the ground, he was thinking about this question.

3. What is the force that causes the moon to move about the earth? Newton said the answer came to him while he was sitting in a garden. When he was thinking about this question, an apple fell to the ground.

4. What is the force that causes the moon to move about the earth? Newton said the answer came to him while he was sitting in a garden. An apple fell to the ground, when he was thinking about this question.

What's the difference in meaning between the above passages?
Students: We have free audio pronunciation exercises.
No comma in #4.
What is the force that causes the moon to move about the earth? Newton said the answer came to him while he was sitting in a garden. __________________________________________________

1. He was thinking about this question when an apple fell to the ground.

2. When an apple fell to the ground, he was thinking about this question.

3. When he was thinking about this question, an apple fell to the ground.

4. An apple fell to the ground when he was thinking about this question.

Which of the above four choices is the best? Which is the worst? Why?
I would use while in the third and fourth example. I can't see anything wrong in your sentences shifting clauses is just a choice with the help of which you stress the thing which seems most important to you.Did you understand this complicated sentence?:D
Students: Are you brave enough to let our tutors analyse your pronunciation?
#3 is the best because the main clause, carrying the new and significant information, falls in the position of stress-- the end of the sentence.

#2 is the worst, for the opposite reasons: the point is in a dependent clause at the insignificant beginning of the statement.