I'm not sure I can find an answer, but I do have a question. In which app are you using PIP mode? Chrome? Safari? Home? Something else? A solution may depend upon which app you are using.
Sometimes I solve problems like this by looking at the list of processes using the "ps -x" command. It's entirely possible that the PIP window starts a new process. If you look at the process list before and after you start the PIP, you may see a new process name. If there is a new process, you can poll this process once per second to check if it exists. If it starts up, you can use that to start a new app. This approach has worked for me in very similar situations to yours.