I figured it out! I must say I am feeling rather awesome right now… this is what late night Max sessions are all about!
I found the answer by thinking about the problem in a different way. Don’t watch this_device, looking for when the path changes. Instead, watch the path, and look for when the device on it changes. A subtle difference… but it works.
I’ve attached the patcher here – it’s fully commented up so anyone who is interested should be able to work out what’s going on. Please try it and let me know whether it works for you.