It's actually quite easy:
Just have a command block that is on a clock, and it should constantly testfor a player at certain co-ords: /testfor @a[x=???,y=???,z=???]
/testfor @a[x=???,y=???,z=???]
(copy exactly except replace ? with the co-ords) then put a comparater leading out of it to a command block that /tp @p ??? ??? ??? (x,y,z).:
/tp @p ??? ??? ??? (x,y,z).
You can also do /test for @a[x=???,y=???,z=???,r=?] where:
/test for @a[x=???,y=???,z=???,r=?]
Where r is a radius (e.i.e. if r is is 3 it will test for players within 3 blocks in a directions of the co-ords specified.