Sliding mc

I made this code for sliding mc up and down.
But there is the bug.
It wouldn’t slide in opposite direction on the first click on the button…
Also can’t figure it out how to disable sliding when mc reaches upper or lower line…

Maybe this isn’t the optimal solution???

http://www.galahala.com/slide.zip