Oops- Sorry, I didn't see the 3.2 reference, and Alice3 doesn't use lists.
Assuming that you are going with the original distances of the objects at the start, there several solutions.
1) Newby Solution- Build an array of spheres. Have the fish say the distances to each array entry, and write them down. Manually change the positions of the spheres in the array to match the distances.
2) Advanced Solution- Create two arrays, one to hold the spheres, and one for distance. When the world starts, first perform a loop that loads the distance to each sphere into the distances array.
Next, sort both the distArray and sphereArray entries into ascending order based on the values in the distArray.
Option 1 will work if you never modify the positions of your objects.
Option 2 is obviously more complicated because it involves a sort routine, but will also allow all of the objects to be moved to random locations when the world starts, and still accomplish the task.
Problem solved, just loop through, and move to, the sphereArray objects in order.