Standard NFS problem, it cannot be fixed without breaking NFS. The
problem is that NFS is stateless, it does not know for certain that you
have closed the file you were editting. Instead it assumes the file is
open for n minutes after the last write, n varies across NFS servers
but is typically hours.
The only solution is the one you found, update executable files
directly from the NFS server, not over the NFS link. This applies to
binaries as well as scripts. Much better to copy the files to your
machine, work on them there, tar them up, copy the tar file to the NFS
server then logon to the NFS server and untar the files. Or logon to
the NFS server and edit from there.