I would say this is a good use case for JavaScript and a function.
Place the function in the onLoad event of the slide.
Basic setup would be something similar to this…
window.myCustomFunction = function() {
if (prez.variable("myVar") == "someValue") {
prez.object("myShape").hide();
prez.object("myOtherShape").show();
prez.variable("someVar", "newValue");
prez.object("myShape").state("stateName");
etc...
}
}
Now - wherever you need all these things to happen - all you need to do is call the function.
onClick
Execute JavaScript
myCustomFunction();
Hopefully this helps.
I talk a bit about functions in this resource as well.