I think, as a general rule, there are no guarantees about how many times
such a function might be called, since the formatter may do multiple
passes, or even back up and try again within the same pass, in some cases
(not sure if the FOSI engine does this, but other formatting engines
certainly do).
If you can't make the VB function resilient to multiple calls, you could
handle it in the ACL function by maintaining an associative array, keyed on
the OID, which caches the result of the previous call and returns that
instead of calling the VB function again. You'd have to flush the array
between publishing runs, perhaps by using the formatcompletehook to detect
when the run is finished.
-Brandon 🙂