Looping through targets multiple times

Is it possible to loop through a series of targets between a time period or for a set number of iterations?

Here is what I would like to do. I would like to set up a series of targets that are variable stars, let’s say 5 stars as an example. For each star I want to take a couple of luminance frames for photometry and a frame with a diffraction grating for spectroscopy. At the end of the 5 star list I want to wait for 10 minutes, then go back to the start of the target list and grab another set of frames for each target.

I’d like to do this over a period of several hours so I can get light curves from a handful of targets over a course of the night.

I can’t see a way to restart a sequence or loop over a sequence once it’s complete. If it’s not an available option I think it would be a great little feature to add, and probably not that hard to do either.

Thanks

J.