The up and down movement of the rope between two people is most likely used to model how energy is transferred through a medium.
In this scenario, the rope acts as the medium through which the energy (in the form of mechanical energy from the movement) is transferred from one person to the other in the form of waves.