Complex custom conditions
Basically, a profile can only have a few state conditions, and the only available logical conjunction between them is AND. I understand why editing anything more complex in that editor field would be difficult. Which is why I'm suggesting a new feature called custom conditions.
These would live on their own tab like variables. When you add a new condition, you'd first have to declare a name for it and then you'd be brought to an editor similar to the task editor.
In the top level of this editor you could add the basic logical conjunctions: AND, OR and XOR. (Each of these would have a checkbox for inversion so NOT is not necessary.) This would add a box with another widget for adding inputs. These inputs would be either states (the same as the conditions for tasks) or other logical conjunctions.
When you're done, this custom condition would be usable as a state condition for tasks.
----
Yes, I'm aware that this could be replicated with variables. But that would litter the profiles tab with all the profiles necessary for this and the variables tab with intermediate variables. This way, these complex conditions could be kept on the separate tab and wouldn't be shown as active profiles.