1- We use the (a) to give some background details to the main story, for example, describing the weather at the time.
2- We use the (b) for an action in the past that was interrupted. It also describes actions or events in progress at a specific moment in the past.