Breck - The Ignore_Exit might work better for you on a UI script, something like this. Should work but caveat is the script fires off not only when you visit another panel and conditions aren't met but also if you try to hit the X in the top right to close (cancel) the whole screen. One has to click the Cancel button instead. You should test the heck out of this before deploying.
'PO_Panel_OnExit_IgnoreExit
whse = """"
retval = oBusObj.GetValue(""WarehouseCode$"", whse)
r=oScript.DebugPrint(""whse = "" & whse)
r=oScript.DebugPrint(""oBusObj.EditState = "" & oBusObj.EditState)
r=oScript.DebugPrint(""oBusObj.RecordChanged = "" & oBusObj.RecordChanged)
If (whse = ""TMP"" and oBusObj.EditState = 2) Then
retVal = oUIObj.SetVar(""IGNORE_EXIT"", 1) 'prevents exit of panel
sMsg = ""Oops the Whse Code is stil TMP."" & vbCrLF & ""Lotus and Jewel say you can't pass GO.""
retMsg = oSession.AsObject(oSession.UI).MessageBox("""", sMsg,""Title=Warehouse Code Check,Icon=!"")
ElseIf (whse = ""TMP"" and oBusObj.EditState = 1 and oBusObj.RecordChanged = 1) Then
retVal = oUIObj.SetVar(""IGNORE_EXIT"", 1) 'prevents exit of panel
sMsg = ""Oops the Whse Code is stil TMP."" & vbCrLF & ""Lotus and Jewel say you can't pass GO.""
retMsg = oSession.AsObject(oSession.UI).MessageBox("""", sMsg,""Title=Warehouse Code Check,Icon=!"")
Else
retVal = oUIObj.SetVar(""IGNORE_EXIT"", 0) 'intentionally set the opposite state if above conditions not met
End If