Stumped On Idea for Project

I’ve been trying to figure out how to implement a macro, into my main macro, that can detect a change.

For example, if a process makes two interfaces switch back and forth repeatedly between, I want the macro to detect if that process comes to a stop.

I’ve attempted to use found image and have explored every troubleshoot I could find online, but have had no success. OCR has provided about 1/4 of a solution, but I need another command/function.

If anyone can assist I would appreciate it greatly. Thanks in advance.