Being a bear of little brain I get confused with what the tenses are called. If you translated that as you have it would make sense in English.
I think in English you have put this into a "Continuous Past tense ( I just learned that, which means it wasnt completed). It indicates that you may not have concluded "were you speaking (when <something happened>)", although without the second part it is obviously implied. As in "were you speaking to yourself" and not said was but implied "before the elephant charged the village"
Someone more linguistically minded should be able to put this more clearly.
And to add: Because the narration in books is usually first or third person, people are really not used to hearing "sprachst" or "trankst". They just sound weird. The forms exist, but aren't almost ever used.
IMO Duolingo should focus on the verbs that are sometimes used in second person (warst, dachtest, etc.) and not use examples that you would almost never see or hear in real life.
Ah. Didn't realize that. "selbst" as an adverb can be translated to "even", but in this sentence it is a pronoun and the other meaning does not fit at all.
EDIT: and to the "why do we need it there":
- Sprachst du mit dir?
would kind of translate: "Did you talk to you?"
So the "selbst" adds the "-(r)self" there.