Disclaimer:I was never a huge fan of the cmd+z shortcut in Safari.
I'd suggest no longer binding the cmd+z shortcut to reopening closed tabs when a text-input has focus. Maybe that could be a middle ground for those that like the shortcut for reopening tabs and those that think it shouldn't hijack the text-input shortcuts?