I'm guessing this movement is part of a bigger simulation, and so it needs to run alongside other "happenings".
Here's the methodology I would use:
1. Create an array for the spheres, made up af a TYPE containing position, "next position", and speed.
2. Position is the default, idle position for the sphere.
3. "Next position" is a position you want to move to, located around the idle position.
4. Speed is the value at which you want to get to the next position from where you are now.
Now, you can create a function that iterates through all of your spheres. At random intervals, you can change the "next position" and the speed to new values. You would also move towards the new position each time, based on the speed value. As long as you make the change faster than the spheres can reach their new position, they will move continuously.
Because it's a function, you can call it in your main loop, and then go on to do other things too.