The original meaning of mezuzah מזוזה (as in our parasha, Shmot 12:7) was "doorpost". In Talmudic Hebrew the meaning of mezuza was transfered to the parchment we are commanded to attach to the doorpost.
Klein gives the following etymology:
originally probably meaning 'something standing' and related to Akkadian nazazu (= to stand), manzazu ( = doorpost).
He says the word mazal מזל has the same root. Like mezuza, the meaning of mazal has changed from the biblical meaning of "constellation, zodiac" to the later meaning of "luck, fortune". He writes:
From the Akkadian mazaztu, mazaltu ( = lit. 'the standing of the stars'), from nazazu (=to stand), whence also the Phoenician מזל (= constellation, destiny), Aramaic מזלא (= star, star of destiny)
Kaddari mentions the theory that mezuza is connected to the Akkadian mazzazu, but in the end rejects it (however, he does say that mazal derives from there). He says that mezuza derives from the root זוז - "to move", the same way menucha מנוחה derives from נוח - "to rest".
Earlier sources such as Steinberg and Jastrow also connect mezuza to זוז, but none of them explain exactly why. Is the door moving? Is it referring to the person leaving or entering? Any ideas?