What you need is to instanciate the box through code then set its y position to a random value and its z position to the box spacing times the number of boxes created so far.
You can use randf_range()
to get random number in a certain range.
Run that through a loop and you have what you are looking for.