This is an implementation of a scale exercise widely used in jazz teaching. It's sometimes known as the "big scale" exercise.
Let's say you practice the saxophone and you want to make sure you know all your major scales. One way to test this would be to play the scale within the limits of your instrument - saxophones have a lowest note and a highest note (from :Db3 to :A5 at concert pitch in Sonic-Pi speak - see here http://en.wikipedia.org/wiki/Alto_saxophone#Range - assuming you don't get fancy with harmonics!)
Playing an Eb major scale over the whole range of the instrument would mean playing from :D3 to Ab5 (concert) as the lowest and highest notes available don't appear in the scale (:Db3 and :A5 respectively). When you hit the upper or lower limit you just reverse the direction and carry on going.