**Neither a teacher nor a native speaker.**
First off: "Were you ill last week?"
I believe you don't have to use "was having", "had" sounds correct to me.
In my opinion, you could use "was having" here:
He: "Why did you not open the door last night?"
You: "Sorry, I was having a bad cold that moment, that's why I did not want to go out. Furthermore I did not know it was you."
(You link two events.)
But a cold does not come for a moment, it takes a long time (as you said).
(Maybe it's grammatically correct, but not meaningful.)
Let's wait until our teachers say something
Student or Learner