I'm not sure that type of calc is applicable. What might be more functional would be an OnObjectEnter/Exit trigger that sets a global flag that you compare against.
EG in your OnObjectEnter script:
Set Variable [ $$portalActive ; 1 ]
Your hide condition calculation:
Your OnObjectExit script:
Set Variable [ $$portalActive ; "" ]
I'll try that.