Noted in Dewford Town (persistent issue).
There appears to be no reliable memory which can be read to determine if a message box is open. In theory sFieldMessageBoxMode should be 2 while a field message box is open (including normal message boxes, which is fine for our purposes), but it appears unreliable. Currently using the gScriptContext script pointer to determine if a script is in progress, which mostly works for the normal field textboxes, but doesn't seem to work for the PokeNav.