Try this.
Put the clearinterval at the starting of the function.
stop();
function goNext(){
clearInterval(timer);
currentSlide.gotoNextSlide();
}
var timer = setInterval(goNext, 500);
//Second
stop();
function goNext(){
clearInterval(timer);
_root.presentation.gotoSlide(_root.presentation.slide1);
}
var timer = setInterval(goNext, 500);