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* and *tu* are stressed):

> Oggi io ho cucinato, io ho lavato i piatti e tu hai solo mangiato, domani o cucini tu o mi porti al ristorante!

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

As suggested by DaG and Denis Nardin, in some cases the *imperfetto* is used to interpret the English past continuous, first example:

> *I was quietly going on my way, when I came across a fox*

> Me ne andavo bel bello per la mia strada, quando mi sono imbattuto in una volpe

or, equivalently:

> Stavo andando bel bello per la mia strada, quando mi sono imbattuto in una volpe

Second example:

> *When WWII happened I was working as a beautician*


> Quando la seconda guerra mondiale scoppiò, facevo l'estetista

here if you say:   

> Quando la seconda guerra mondiale scoppiò, stavo lavorando

it seems that, when WWII was declared, you were at work :)