That's far more complicated than necessary.
function _edit_command_to_register_full_path {
emulate -L zsh
for element in ${(z)1}; do
# Don't care about parameters
[[ $element == -* ]] && continue
FULLPATH="${element:P}"
# Don't replace when already the full path
[[ $element == $FULLPATH ]] && continue
# Don't replace when path doesn't exist
[[ -f $FULLPATH || -d $FULLPATH ]] || continue
# [[:space:]] to protect previous replacements
# (this is still not foolproof for path prefixes)
set -- "${1/[[:space:]]$element/ $FULLPATH}"
done
print -Sr -- ${1%%$'\n'}
return 1
}