I don't see why a script triggered from within the portal should produce different results from a script triggered from a field outside of the portal, but you might try adding a refresh window script step immediately after your script updates the variable.
You're right, apparently they do both behave the same way (not evaluating the calculation). Not sure why they appeared different to me the first times. Thought I checked it a lot.
In any case, the 'refresh window' step solved it beautifully. Thank you!
And I forgot that there is a new script step: Refresh Object that should also work for this. Use the Name box in the inspector to give your button an Object Name and then Refresh Object should update its visibility without having to refresh the entire window.