Can the Flag module be used to lock content while editing to prevent concurrent edits?
You can do it by using the node_validate function.

Your relevant part code is that :

if (isset($node-&gt;nid) &amp;&amp; (node_last_changed($node-&gt;nid) &gt; $node-&gt;changed)) {
    form_set_error('changed', t('The content on this page has either been modified by another user, or you have already submitted modifications using this form. As a result, your changes cannot be saved.'));
  }