Have you looked at the existing lock manager smartapps? They’re quite popular, and typically free or minimal contribution.
Here’s one example: