You can open and flock$0 to see if the program is already running. This is assuming that flock is reliable on your system, and that some other process doesn't have the file open for some other reason. An example is here.
Comment on Re: only allow single instance of program running