This is a very complex topic!
First, comparing imperfecto and indefinido comes down to the difference between unfinished (that's the technical meaning of "imperfect") actions and completed actions or events.
Pretérito imperfecto, or "imperfect," refers to past events that were not finished in the context; these can be either habitual actions or single instances. For example:
Los pájaros cantaban.
This means "The birds sang (habitually)" or "The birds were singing (at the time the speaker was there)".
Imperfecto progresivo, or "progressive imperfect," also refers to past unfinished events, but what's different is that here the actions were not habitual (except in some specific cases).
Él estaba trabajando a las siete.
This means "He was working at seven" in a context where the speaker, for example, has seen the man working at seven and then left without seeing him stop working. This sentence could work with the simple imperfect too; but the progressive expression emphasizes the continuity or ongoing nature of the work.
Indefinido progresivo, or "progressive preterit," has a misleading name; it refers to past events that were finished (in the context of the meaning the speaker wants to convey). The progressive part means that something happened for a while -- and then stopped.
Ayer estuvimos bailando toda la noche.
This means, "Yesterday we were dancing all night (and then stopped)." You cannot use the imperfect here because the qualifier toda la noche would make it nonsensical; because it was "all night" (i.e., the whole night), the meaning includes the idea of an end, a stopping.
If you're writing about something that was happening while something else happened as well, you use the imperfect (either simple or progressive):
*Ayer estábamos bailando [or bailábamos] cuando comenzó a llover.* "Yesterday we were dancing when/as it started raining."
If the action went on for a while and then stopped (i.e. the speaker perceives that it stopped), you use the progressive preterit:
Él estuvo trabajando en su oficina hasta las ocho. "He was working in his office until 8 o'clock."
If the event is habitual or customary, you use the simple imperfect:
Los pájaros cantaban todas las mañanas. "The birds sang [or would sing] every morning."