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 (a cultured Manzoni's quotation proposed by egreg):
Per una di queste stradicciole, tornava bel bello dalla passeggiata verso casa, sulla sera del giorno 7 novembre dell'anno 1628, don Abbondio, curato d'una delle terre accennate di sopra […]
I don't dare to translate it in English but don Abbondio was coming back...
Second example:
When WWII happened I was working as a beautician
Quando la seconda guerra mondiale scoppiò, lavoravo come estetista
here if you say:
Quando la seconda guerra mondiale scoppiò, stavo lavorando
it seems that, when WWII was declared, you were at work :)