The error is telling you what's wrong. In more detail: tag event scripts implicitly get a parameter that's calledevent. However, this is not the 'EventObject' that is expected by system.gui.getParentWindow. As the system.gui package implies, the event object you're expected to provide to system.gui.getParentWindow is a GUI event, such as a mouse click or key press.
The only way that line of code would ever work was if you were invoking it from a GUI event, such as a button's actionPerformed. Moving it to a client event script means it will never work, as written.
I suspect that the proper place for this logic is going to continue to be a GUI event hook.
Think of it the other way around - this code you've written is reacting to a tag changing. How would the client associate an event that is just "this tag has changed" with any particular window? You must either A: invoke GUI logic from a GUI event or B: make an assumption in your script that "this tag has changed" means that, for instance, 'main window X' is open, and grab it by name.
Are you trying to do this when you open the popup? If so, just place the values you want for the popup's root container into the parameters dictionary of the system.nav.openWindow() call, using keys with the same names as the popup's root container properties.