Hey, bring more what you got and please as you see better fits share those. I do see places that count-down could shave cycles and make a tight loop() even tighter. It could mean running a check at higher frequency but TBH (to be honest) there are competing methods for getting to the same extremes though the code for those is often hard to follow, not like slotted timeouts could be.
I use snippets where logic is more clear than English, and saves typing. It's not always so easy to separate a principle from the mass of detail that many projects require and we don't all have time to do that just for a minor point in a discussion.
One thing I noticed in your first code in this thread is the amount of optimized AVR code that at least some struck me as where it's not needed. I gathered, perhaps incorrectly, that you did that from not knowing what Arduino has brought to the table in the way of simplifying. But the simplify has general use safeguards that are not optimal (sometimes add whole microseconds) so perhaps knowing what you know, you kick the mud off your shoes as it were. I would too

but I'm too old to learn all that for just hobbying.