In some instances ἔλεγεν and other verbs in the form of imperfect do not really convey a past continuous sense, but a sense of an instance and a singularity of action, like aorist. Here is a salient example: Mark 9:24. “Immediately the father of the boy cried out and said (ἔλεγεν), “I believe; help my unbelief!”, here ἕλεγεν simply cannot have a notion of continuity (see Bill Mounce's very nice blog on various usages of imperfect from where I took this example https://www.billmounce.com/monday-with-mounce/how-can-the-imperfect-be-instantaneous).
As to this particular instance, it seems that even though it is in an imperfect form, the meaning must be an aorist and instantaneity, for it is illogical if Jesus said once to the unclean spirit(s) to depart the man, what on earth could have held poor fallen spirit(s), who tremble in divine presence (James 2:19) in him after that?! If even Paul needed only one sentence (in form of the aorist εἶπεν) to expel demon from a woman (Acts 16:18), how much less Jesus who gave to Paul this ability (while Himself possessing this ability properly and inseparably), could have needed more than one sentence!
If ἔλεγεν here has a continuous significance, then the only explanation can be that He said it not several times, but that He was in the process of telling this one sentence to demons, who, understandably, immediately left the man as soon as He finished this only sentence. It is a blasphemy to even think that any of the demons could have kept in the man after Lord has once commanded them to leave the man.