Create multiple scenes on the X axis (or globally in XYZ matrix) by ruby code

Maybe this way it will be easier - I found this code from this thread:

It makes scenes around the object.

I want the same idea, but to make scenes on the line. It may be also used for animations - so maybe I need to make a large amout of scenes.