Tasker supports grouping of states in profiles from the beginning. The enter task starts when all states become active, the exit task starts when one of the states become inactive.
The notion of nested contexts proposed here changes the behaviour of the exit task only. Namely, contexts in a profile are ordered, there are broad contexts and narrow contexts, the exit task starts if a narrow context becomes inactive while all broad contexts are still active.
For example let's consider simple profile
profile HomeAtNight
broad state Time from 22:00 to 6:00
narrow state WIFI Connected HomeAP
enter task