Add the keyword "ever" to conditional syntax
The word "ever" seems to be implied in the syntax for looking backward. Although the semantics of "has been x" and "has ever been x" are the same, if you consider having "for x turns" added to the condition, then the use of "ever" would provide a useful semantic difference. "Ever" releases the end point of the counted consecutive turns so that it need not be the current turn. "Has been x for y turns" can go away. "Has ever been x for y turns" can not.
Instead of drinking the milk:
if the milk has ever been unrefrigerated for 60 turns, say "Pfffft!!!!".
Re-refrigerating the milk doesn't help. It's already too late.
This is a way of looking into the past that is not currently provided, yet it feels quite natural and intuitive.
I'm not sure if to implement this you'd have to steal a bit from the trips or consecutives counter, repurpose the trips counter, or use an additional whole 15-bit state tracker, but I think the mechanics might not be too tough.
As a final note: this thinking also suggests that the true syntax of the non-counted condition should be "has ever been x". Indeed, the documentation uses the word "ever" in describing the effect of the "has been x" syntax. "Has been x" thus becomes an acceptable abbreviation of "has ever been x".
Joe Aultman commented
Thought about it some more. It seems you can set up a separate array or bitmap for those "ever been x for y turns" values. Every rule evaluation sets that value equal to itself 'or'ed with (TestSinglePastState(past_flag, pt, turn_end, 6) == y), then does an 'if' against the result.