How to tell if node has been updated via UI form as oppose to programmatically?
Create an additional field in the content type - for example update_source - and set the value programmatically.

If the user is editing the node on node/[nid]/edit page, set the value to UI and otherwise set it to programmatic.

You can do this with simple hook_form_alter() and URL checks to make sure the user is on node/[nid]/edit page. Something like this would work:

if (arg(0) == 'node' &amp;&amp; arg(1) &amp;&amp; arg(2) == 'edit') {
  // Your code
}