1. je veux -- could be either one, but imperfect is more likely. Imperfect indicates that you were wanting to open it for some time and does not indicate if you succeeded or not. Emotions are often in the imperfect. However, using the p.c. would indicate that you tried to open it but did not. You wanted, briefly, until it couldn't happen. It could also work. It's a matter of the viewpoint the speaker wishes to express. Neither is truly wrong. Although, for a class, the teacher might be expecting you to pick one (probably the imperfect) over the other, based on what has been recently taught. FYI -- either one works, but gives a different meaning. I recommend the imperfect unless you know the p.c. is also acceptable per what your teacher has said.
2. #1 sets up the scene, the background info. What follows are the events that took place while you were wanting. Those are in p.c.: se retourne, me dit.
Using imp. instead would indicate that this was a repeated habit in the past. He used to turn around and used to tell me. That would be strange in this context.
3. qu'il a la grippe (that he has the flu), is more background information. He had the flu before you started the story and after its completion. That's imperfect.
Using p.c. would mean he just got the flu. It doesn't make sense here.
4. que je dois -- also imperfect. You are obligated to remain still for that period of time. Length of obligation is more important than it being over.
Using p.c. would not make sense here and be translated as: that I must have remained still (instead of: I had to remain still -- I was obligated to remain still).
5. some additional hints:
a. imparfait -- is like watching the video, to relieve that verb - it's the background info. passé composé - is like noting the verb (a change of state or a completed action) on a calendar or timeline, without dwelling on the length of time needed. It lists the events that happens during the background info.
b. If you can reword it in English to be: I used to open/was opening; I used to want/was wanting to open... He used to turn around/ was turning around, he used to have/was having the flu, etc then it's usually the imparfait.
c. If you can reword it to: I have opened. I have wanted to open. He has turned around. He has had the flu, etc, then p.c.
d. If you can't do b or c, then it's also probably the passé composé. I
a, b, c are a set of guidelines that works 80% of the time. When you're not sure, use them.
taught French; native English speaker