Try this:
First: Ccreate an Item that's the specific Pokéball. e.g:
520,SHADOWBALL,Shadow Ball,3,0,"A dark ball, that turns regular Pokémon in Shadow Pokémon.",0,2,4
Important are the last two parameters (2 and 4). It says that the item can be used directly in the battle and it's a pokéball...