As you’ve probably seen, Bubble evaluates expressions left to right, so you can’t bracket expressions within an expression.
I’d suggest having 2 separate workflows, each with an “only when” condition. Given your expressions, either one workflow will execute or the other. It may be easier to write them on the front end to experiment with them, then once you have them working, move them to the back end.