Ok, here is a capx with the type of movement I believe you are looking for.
From what I read, it looks like the problem with how you have it set up is, the event "is overlapping background". This is always true if the sprite is overlapping the background and will always run (even if the background is behind the goal and the sprite is only touching the goal, if the background is behind the goal, it is still overlapping the background).
I use an else to test if not overlapping the goal. Also, I don't know how much his helps, but I think you should initialize all instance variables in a for each block. I did so in my capx for you.
Good luck with your project.