Not a bad idea. I had thought of something similar. I guess I left out something in my original postb though: in this case, I'm actually working with a couple of different scripts that use the same files (one is a daemon and one is a CGI front end for interacting with it). There will probably be a couple more in the future. So in this case I need several differnt scripts to all adhere to the same locks.
So does the whole file locking over NFS problem boil down to NFS being poorly designed (or at least being poorly designed for use by more than one client at a time) then? It seems odd to me that NFS has this big achilles heal given how long it's been around and how widely deployed it is.