You haven't said how it doesn't work.
What I noticed about your event is that you have the
pbWildBattle code in a Conditional Branch, and you've put the
Control Self Switch in the "else" part of it. That's usually not how wild battles are set up -
the wiki page doesn't say to put the battle itself in a Conditional Branch (although I'll admit there's no clear example).
The
pbWildBattle should be in a Script event command by itself, and always followed by the
Control Self Switch command. If you want to do different things depending on the outcome of the battle, then you make use of the fact that the outcome is stored in Global Variable 1 (according to your code) by creating Conditional Branches
after the battle and doing whatever. That is, you leave the battle itself alone, and just play with the part after it.
I'm not saying you
can't do it your way. Your event will run the battle as normal, and then turn the Self Switch on
only if the player lost the battle. That behaviour is unexpected, and can lead to infinite captured Suicune. If you put the
Control Self Switch in the first part of the Conditional Branch, then it will be done if the player wins/flees the battle (by any method), while leaving Suicune free for rebattling if you lose against it.
Your code also says you can't flee from the battle, and you'll be fully healed after losing instead of scurrying back to the last checkpoint. To me, that's also unexpected for a battle like this (what special force is preventing the player from fleeing/will heal the player after they lose?), but that's up to you.