Moving Platforms

In my game- http://www.flowlab.io/game/play/1232174
Im trying to create a moving platform that goes back and forth between walls, I also would like to know how to make it go back and forth without hitting a wall to make it less predictable. All help is good. I also need help with how to fix the player from jumping up walls.

Have invisible blocks that have collisions enabled, but isnt solid. use Alpha to make the block invisible.