Grease pencil - one loop then another

Can anyone tell to me the quickest way in grease pencil to have an object loop frames 1-12 for a while, then play frames 13-20, then loop frames 21-32 for a while, play frames 33-40, then loop 1-12 again.

you can animate the time offset’s frame value, if you set it to fixed frame mode.
Or better use a bone to drive it, so you can create actions/NLA strips
or something like “(frame<offset) * sin(frame * freq + phase) * amp” as a driven expression for example

I made a little clip a while ago

Is that with the Time Offset modifier? Keyframing (or using a driver to control) both framestart and frameend?

you have to set it to fixed frame. Then you don’t need to worry about start and end frame.
i made a little step by step video.