Last August, I helped someone else with an almost identical requirement. They wanted to detect “stale sensors” (any sensor whose value hasn’t been updated in the last hour or 4 hours or whatever time period you prefer).
It demonstrates the principal with a few template examples (all similar to what CentralCommand posted). It applies the technique in an automation that runs every 4 hours and checks if any sensors failed to update during the past 4 hours. If it finds stale sensors, ot reports their entity_id via a notification.
Basically, it does most everything you require, without the complexity of the choose you intended to employ.
Thank you. I will try to adapt the code to my requirements, because I don’t use the default “last_change”, I made some variables where I store the last change, in order to keep the data after HA restart.