I wrote a module for client (so I can't share the code) to take care of this, because I wanted to deal with the issue you described, as well as the issue where a previous run failed -- because some cleanup might need to be done.
I created an object based on the called script (I passed $0 in to the module) which then checked for a corresponding file in /var/run. If it existed, it meant that the script had been started previously. If the PID inside that file was still active, it meant the previous invocation was still running; if not, it meant that the script had crashed without 'unlocking' itself. And, of course, if the file didn't exist, I created it, using the PID of the currently running process.
This approach has worked well over the last three years.
Alex / talexb / Toronto
Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.