Hey Kenneth,
You may want to make some changes to the script logic.
From https://help.mypurecloud.com/articles/set-screen-pop-action/
Any values passed to script variables that use this action are visible as participant data on the interaction. You can view the data on the interaction details and you can export it using analytics APIs.
I'm guessing that there is participant data leftover from going through Queue A, and that's why Script A is showing up in Queue B.
------------------------------
Jason Kleitz
Online Community Manager/Moderator
------------------------------