In the scenario you've described, the last edit "wins".
I don't believe there's an option to lock list items, but your idea sounds interesting:
First query to make sure the usernameLocked column is blank. If it's not blank, someone already locked it so show appropriate error.
You would need to write the list item (using SubmitToSharePointList) to set the usernameLocked column to ernestom, for example.
When the user is done editing and clicks submit, remember to clear usernameLocked.
Sounds like a good idea; let us know how it goes!