When you scroll to the bottom of the earthball.c file you'll see a while(1) loop to control the camera.
Before the wait(1) at the end of that while loop you can insert some code to check the z value of the eBall entity:
if(eBall.z < - 100)
{
eBall.z = 500;
}
edit:
You cannot attach a function to an already created entity.
But you could attach an already created entity to a function.
So this could be another way:
void earthball_Control(ENTITY* _ent)
{
my = _ent;
while(my)
{
if(my.z < -100)
{
my.z = 500;
}
wait(1);
}
}
Now add this line to your main function _before_ the while(1) loop:
earthball_control(eBall);