What about changing this to check for the presence of an `edit` command anywhere on the path?  Something like `which edit && unalias edit` (not sure if that'd actually work or if you'd need to do the full `if [ ... ]` syntax.