I answered to your analogous question for the present continuous, now I do the same for the past :).

First of all, as DaG already told you, Italians don't usually say:

> Io stavo andando a casa

but only:

> Stavo andando a casa

unless you want to emphasize the subject, for example (here *io* is stressed):

> Io ho lavato i piatti, non tu, fannullone!

Regarding the *imperfetto di stare + gerundio*, it is more or less like the past continuous in English, it is used to describe an action that was occurring in the past when some other action happened, for example:

> Stavo andando tranquillamente a casa in macchina quando, all'improvviso, davanti a me è sbucata **(not completely grammatically correct but used)** una volpe 

or 

> Stavo andando tranquillamente a casa in macchina quando, all'improvviso, davanti a me sbucò **(correct but used only in formal Italian)** una volpe

The *imperfetto* is used for habitual actions:

> Quando abitavo a Milano, andavo al lavoro in tram tutti i giorni