I have a solution to this issue:
1) Take the moving sprite (for example your vertical moving bar) - position by the left wall and record its position (x,y)
2) Go to the events sheet and add an event, select the sprite and double click on collision with another object (collision sprite)
3) Add to actions for that sprite A) Drop Drag Drop and B) Set position (here is where you place the position (x,y) ) this is where the sprite will stop when collision is true.
you need to do this to all possible collisions along the path of the sprite.