Make another tag of type Date to store the time of your existing tags last transition. In your existing tag, add an OnValueChange event script that sets your new date tag to system.date.now() whenever
previousValue.value != currentValue.value
Then make a third tag, an expression tag, that evaluates to the time between the above date tag and now(). Give it an OnValueChange event script that checks if the currentValue.value is greater than your predefined number of seconds. If it is, then reset your existing tag to the default.
See this post for something similar: Timer function that works gloabally(gateway)