This worked in fixing the syntax error. Thanks! Unfortunately, the opponent is still able to knock the ball away. I'm assuming it's to do the the few lines of code right after that mention knocking the ball away. I tried replacing the lines after if @opponent && (!pbIsSnagBall?(ball)) with a copy of some of the code for catching pokemon, but that made the game throw the ball and then ignore it. I tried replacing it with a copy of all the ball throwing text, and then I got another syntax error.  Here's the code for ball throwing/catching pokemon if it's any use. 
 
	 
 
	@scene.pbThrow(ball,(critical) ? 1 : shakes,critical,critsuccess,battler.index,showplayer) 
	       
	      case shakes 
	      when 0 
	        pbDisplay(_INTL("Oh no! The Pokémon broke free!")) 
	        BallHandlers.onFailCatch(ball,self,pokemon) 
	      when 1 
	        pbDisplay(_INTL("Aww... It appeared to be caught!")) 
	        BallHandlers.onFailCatch(ball,self,pokemon) 
	      when 2 
	        pbDisplay(_INTL("Aargh! Almost had it!")) 
	        BallHandlers.onFailCatch(ball,self,pokemon) 
	      when 3 
	        pbDisplay(_INTL("Shoot! It was so close, too!")) 
	        BallHandlers.onFailCatch(ball,self,pokemon) 
	      when 4 
	        pbDisplayBrief(_INTL("Gotcha! {1} was caught!",pokemon.name)) 
	#        @scene.pbThrowSuccess 
	        if pbIsSnagBall?(ball) && @opponent 
	          pbRemoveFromParty(battler.index,battler.pokemonIndex) 
	          battler.pbReset 
	          battler.participants=[] 
	        else 
	          @decision=4 
	        end 
	        if pbIsSnagBall?(ball) 
	          pokemon.ot=self.pbPlayer.name 
	          pokemon.trainerID=self.pbPlayer.id 
	        end 
	        BallHandlers.onCatch(ball,self,pokemon) 
	        pokemon.ballused=pbGetBallType(ball) 
	        pokemon.pbRecordFirstMoves 
	        if !self.pbPlayer.owned[species] 
	          self.pbPlayer.owned[species]=true 
	          if $Trainer.pokedex 
	            pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.",pokemon.name)) 
	            @scene.pbShowPokedex(species) 
	          end 
	        end 
	        @scene.pbHideCaptureBall 
	        if pbIsSnagBall?(ball) && @opponent 
	          pokemon.pbUpdateShadowMoves rescue nil 
	          @snaggedpokemon.push(pokemon) 
	        else 
	          pbStorePokemon(pokemon)