There's dumplock under windows. There's no other way to check for locks on a table. If some other process is performing inserts or updates the locks will come and go so it will be just as likely to see no lock as to see the lock. If you need to synchronize processes you should create and set your own semaphore of some kind. Possibly a file or a record in an auxiliary table.
There is a dumplock program that outputs the state of the locks in a usable manner.
I would not rely on the lock state to say if the other process is updating, as it may not have a lock at the moment you look at it. Can you tell by existence of the temporary table, or if there is a recent update?
E.g.
SELECT NAME FROM SYSTABLES WHERE NAME = 'TMPTABLE';
or
<SQL MAX=1 "SELECT id FROM TMPTABLE where id > '-1 minute'">
Looks like I'll have to set a flag in a table when the process starts, but how can I guarantee that the flag will be cleared even if the process aborts? I'd like something like a Try Catch Finally statement.