Separate Logic from Content
To program interaction logic, sequences or any other more complex tasks, you should NOT start to weave the logic part deep into your patches but rather have a central command station where you handle all the logical states in an abstract way and send them as needed to other places in your patch.