Hello Carlos
As currently implemented, global timers are not able to be paused and restarted. I will try to incorporate that feature in a future update.
In the past, I have handled this issue by enforcing a "grace period". When the subject first leaves the port, the state changes to a "grace" state, where a fixed amount of time is provided for re-entry, before terminating the trial. This way, momentary withdrawals from the port are not counted as leaving events.
-Josh