Check custom data field value change to trigger activity status change
I am not sure if it can already do exactly what you want, but my advice is to first look at the CiviRules extension.

https://civicrm.org/extensions/civirules