You could do it that way, by using the "modify_tag"document callback to attach a dlgitem callback to the "OK" button on the modify attributes dialog.
You could also use the AOM to add an event listener to the document for the DOMAttrModified event. That would let you take some action in the event of a particular element having a particular attribute value set, no matter how the change is made (via Modify Attributes dialog or via script).
I think the examples in the customizer's guide should also be available in the HTML portion of the Help Center, as well as the PDF. If you decide to go with the ACL/Modify Atributes route, the OK button on the Modify Attributes dialog has the ID of "OK".