If you had a habit of continuing to wave goodbye long after your friend had left, you might say that you tend to perseverate, or repeat a gesture even after it's no longer appropriate or necessary.
Most people who perseverate suffer from a brain injury, disorder, or illness, and the word is most often used as a medical term. It's almost as if someone who perseverates gets stuck on a word or gesture and can't stop repeating it. Perseverate contains the word "persevere," to continue determinedly, and perseverare, the Latin root, means "to persist." When you persist with clear intentions, you persevere, but when those intentions are lost and only the persistence remains, you perseverate.