What is a morbid condition characterized by automatic and purposeless repetition of words or imitation of actions called?

echopathy — A morbid condition characterized by automatic and purposeless repetition of words or imitation of actions. (Webster's 1913.)

Sources