Just do a system compare, no need for every xx seconds.
The reason you shouldn't use random is because the system doesn't remember what the random value was tick to tick.
Also random uses decimals so use int, or abs, etc, otherwise it may never be equal.