sorry about the extra blank lines in that - email :-;
your example had it going to frame 0 - the start of the entire presentation, whereas the above has the slide looping back to the beginning of the slide on exit. If you want it to loop to frame 0, you can just substitute 0 (slide 0) for e.Data.slideNumber - 1 in the above.... assuming the slide you intercept on is the last slide in the sequence of slides.