That’s a complex blob of code to just stare at but I’ll speculate that you’re probably modifying copies of the Materials when you think you’re modifying the actual ones.
Simplify it… the “auto-instantiate-ness” of Materials can be tricky. Make a small blob of code to set each condition (selected or not) and then put the two calls into an endless Coroutine that does one, waits a second, does the other, waits a second, and back and forth endlessly until you have that working 100% solidly.
There is also a .sharedMaterials array you can access as well, and also this general blurb, which I think you are already aware of based on your code above: