Do you want the ball to bounce off or disappear and appear at the other side of the world?
To make the ball bounce you need to know whether your actor is at the end of the world and then just use Greenfoot.getRandomNumber(int) to make the ball bounce randomly.
Or have a look at World Wrapping by SPower.
The world should add the ball with a random y coordinate and a fixed x coordinate of the right edge of the world. The act method in the class of the ball should make the ball bounce and check for it being at the left edge of the world, at which point it would remove itself from the world.