"Imperfetto" suggests simultaneity with respect to a moment in the past. It is generally used:
To convey an idea of continuity with respect to the past, in this case it requires either an implicit or explicit temporal marker (e.g. Vent'anni fa vivevo a Milano).To express habits in the past, that is the English form “I used to ...”, (e.g. Quando ero giovane giocavo a tennis).Sometimes — even if “imperfetto” is vague about the conclusion of an action — it is used, in literary contexts, to talk about actions that take place successively. This particular use is called "imperfetto narrativo", e.g. "Ora la pigliava su di un altro tono, col risolino furbo e le mani che gli pizzicavano. Le stringeva con due dita il ganascino. Le sollevava a forza il capo" (G. Verga, Mastro don Gesualdo). It is important to remember that “imperfetto”, as suggested by its name, indicates an action which is not perfect (in the Latin meaning of completed) so we cannot use it to refer to an action that took place in a specific amount of time or was completed at a specified point of time, for instance “Andavo a scuola questa mattina” is wrong whilst “Sono andato a scuola questa mattina” is the right form. However, it is important to remember that the conjuction “mentre” is always followed by “imperfetto, e.g. “Mentre andavo a scuola questa mattina, ho visto Lucia”.