Could you explain that one further? I'm not quite sure what you mean.
I'll try. Each visportal actually has two sides, each facing into one of the both visleafs the visportal is connecting. I've created an example setup.
The green line is the visportal, connecting the visleafs #1 and #2 (marked in different colours). The player is in the first visleaf. The green arrow illustrates the normal vector of the visportal facing into visleaf #1. The one towards the other visleaf points exactly into the opposite direction, but that is not important here. If the player stands at position A, he is staring directly at the side of the visportal facing the visleaf he is currently in, causing it to be open.
If the player stands at position B, he is still staring at the visportal, but this time at the side that is facing into the other visleaf. In this case the visportal stays closed.
Regarding the math. I didn't look it up in the code but if you have the normal vectors of the visportals facing into your current visleaf, you can find out which situation is the case by checking whether the angle of the players viewing direction and the visportal normal exceeds then 90 degrees. Only in that case it should be open. This is the same math the trigger look script uses, which I'd explained I while ago.