I suggest you check out the Get ( TriggerCurrentPanel ) and Get ( TriggerTargetPanel ) functions. Part of Filemaker Help notes say:
Returns the index and the object name of the current or (the panel to be switched from) when the OnPanelSwitch is activated.
Use with the Get(TriggerTargetPanel) function. Returns an index value, starting from 1, when running a script triggered by the OnPanelSwitch script trigger, and the object name assigned to the tab or slide panel. Returns 0 if the panel is invalid or if Get(TriggerCurrentPanel) is not used with the OnPanelSwitch script trigger.
I think you probably want to rethink the tab thing here. You can save yourself a lot of trouble now and down the road.
What is the difference between the two tabs? I assume they show the same information, just from different semesters by portal? I'd recommend one portal filtered by a drop down list with options for "Semester 1" and "Semester 2".
With a global selection field, the global won't change going into find mode and back. It'll stay the same if you switch layouts. And it's easier to maintain.