You can check for and find the panel using panelList as you are already. However, if you want to open the other panel you must find the command and run this: performMenuCommand(panel.command) .
By defining a “panel” type entrypoint, Photoshop will automatically add a menu item for your plugin with the name defined in the label field, based on locale. When menu item is clicked, Ps loads the main field in manifest for the contents of the panel. So having negative IDs won’t be a problem because you can search for them by the label you defined.
7200 in the code example refers to part of the menu bar that contains the plugins, and you can pass in pluginName and panelName from what you found in panelList.
const plugins = menuBar.submenu.find(item => item.menuID === 7200)
const plugin = plugins.submenu.find(item => item.title === pluginName)
const panel = plugin.submenu.find(item => item.title === panelName)
const panelState = getAppProperty('panelList').find(p => p.name === panelName)
if (!panelState.visible || panelState.obscured || closeIfOpen) {
performMenuCommand(panel.command)
}