To my knowledge, you cannot tell ahead of time that a particular record or table is locked unless you yourself program a way to know that. You might do better by putting a trap on the event and, if it fails, delay for a second and try again.
You can use a DAO database object to support a DAODB.Execute method for SQL, for which you can use a dbFailOnError option that would cause a failed query to roll back and trigger a trap at the same time. Your trap handler could then detect particular error cases by number (sorry, can't tell you which ones to expect here) and if you get one that is indicative of a lock collision, you can choose to resume execution at a "Retry" point rather than a "Give up and go away" point.