(Explicit answer, hence spoilered. )
Player 1 studies the arrangement of boxes. If you assume each ball points to another box, you will get somewhere between 1 and 300 closed loops.
If all the loops consist of fewer than 100 boxes, player 1 does nothing.
If there is a loop consisting of more than 100 boxes, player 1 picks an arbitrary start point, remembers it, follows the loop for 100 boxes, and swaps the ball in the hundredth box with that in the first.
(It doesn't have to strictly be 100, it can be fewer as long as it splits into two even parts, but a loop longer than 200 boxes needs to be split into thirds instead, so 100 is a safe algorithmic shortcut.)
This is done at most twice, there can be no loops too long after that point.
Player 2 enters. He opens the box corresponding to the target number. He has now selected one of the loops, and we know there are fewer than 100 boxes in each.
He follows the loop around. In the final box, closing the loop, he'll find the ball that points to that first box. And the first box had the target number - so the ball that points to that first box... is the target ball.
Well done. And thank you for clearing that up.