Create button action subject to a given frame range


I have created a movie which have a set of simple navigation buttons which I would like to be able to start playing the movie from a series of labelled frames going to each label dependent on the position in the timeline?

For example if I have a label at frame 1(start_1) and a label at frame 50(start_50) and so on every 50 frames for a set time, what is the best way to code the button to tell it to return to start_1 before it has reached frame 50 or tell it to return to start_50 on reaching frames 51 to 100 and so on, in the timeline.

I gather that I can use an if else statement but how do I set variables to timeline frame positions to which the button will we act in the correct manner?

Alternatively is there a better(smarter) way to do this? :h:

any help, prodding in a general direction is appreciated