On reflection I think that the tracking of activeSubid in my patch is probably overkill if we're attacking it this way. We can just have AtSubAbort_Portals fail any ACTIVE portal regardless of subxact level, which is pretty analogous to what AtAbort_Portals has done for a long time.
Tracking the activated subxact looked neat from my side, that's more consistent with what is done when the portal is marked as ready, particularly with the new routine introduced.
Let me work on this and see if I can get to a simpler patch.