I used a picture of Nemo and modified it so that the fins can move.
The code for the stage makes use of a variable scrollx. The value of scrollx changes as you press the right or left arrow keys. Scrollx can get very big or very small so you work out how many cycles you have completed to subtract that from scrollx to set the x position of the two background sprites.
The if statement to set repeat determines which of the two background sprites will be on the left and which will be on the right.
The code for the one background image is
and the code for the other background image is
This ensures that the distance of the x position of the two background sprites is always 480 apart.(the width of the stage. You can make it a little less to prevent a opening between the two background images
You can download the program fromhttp://scratch.mit.edu/projects/MMyburgh/2782105