I'm sure there are many possible solutions to this problem. I've solved this problem myself, more than one way.
Fundamentally, in a pure math sense, there is NO WAY to know when a variable changes by "polling" it. If you check its value at two separate times, it may have changed 0, 1, or 100 times between those two checks. Of course, if the value of the variable is always strictly increasing, (like a counter) then you would know! But you didn't say that your variable was always increasing. The solution (a truely reliable solution) to this is to make sure that you don't change the variable without validating each time if the variable has changed. And I'm going to show you one way to do that, below.
By the way, another fundamental problem is that quite often a variable gets "changed" into the exact same value. Does that constitute a "change"? I don't know, it depends on your definition of a change. This is a particular problem if the numbers you are storing are "real" values. For example, if the first time you check a value it contains "14.0" and the next time you check it's "13.9999999999", is that a "change"? You didn't say if the variables you are checking are integers, fractions, real numbers or strings. I think we need to know that. There are pitfalls if you are testing real number values.
One way to address all this is to create a subroutine that you always use to change a variable. The subroutine will itself detect if it is changing the variable. For example, I've used macros like this:
This macro will allow you to pass (a) the name of a variable, and (b) a new expression to assign to that variable. If the new value is different from the old value, this macro will say "Changing value" but if the value is not changing it will say "No Change." You can of course replace that with your own code.
I tend to prefer solutions like this to "polling" solutions such as what you are describing. Your approach might be valid for your particular problem, but I prefer solutions that work with all possible problems.
You might say, "but your solution doesn't let me check if 3 seconds have passed." But indeed it does let you check that. My code above simply warns you if the value has changed, true, but you can modify it to also record the time of the last change, which is something you can then use to see if it has changed in X seconds. I made my code above work with ANY variable, not just a single variable like you were requesting, so to make my record the time of ANY variable, it's probably best to use a KM dictionary to record the time of the change. For example, if you replaced my action which says "Changing Value" with the following action:
Then your dictionary would contain the last time change of every variable that you are changing, as long as you use my subroutine to change your values. Then you can test if a variable has truly changed in the last three seconds like this:
Then that will test if the time of "MyVar's" last change was more than 3 seconds ago. It sounds like a solution to your problem.
This approach is quite robust, and I use it often to solve problems like yours. I do things like this all the time, so I probably didn't make a typo above, but if I did, I'll answer any issues you have with it.