This glitch gives you infinite any ball. All you need is to have two Pokemon in battle. You need at least one other type of Pokeball that's different to the one your duplicating in your bag.
With the first Pokemon select Items and then the pokeball you are duplicating. Then with your second Pokemon move the firs pokeball by pressing the Y button to the location of the second pokeball. Then you can proceed to attack or use another item with the second pokemon. Your character will throw the first pokeball but it will still be in your bag.