It seems there is a bug in the code, it takes the previous enable state, but if repeated before the revert time the previous state will the the same as the current so it returns to the same state causing the object to always be enabled in yoru case.
So I made a few adjustements. Please find the new script attached, it will also be available in the next update