How can I loop a 2D grease pencil animation within a longer animation?
I figured it out thanks to wilks' comment above.
It can be done by adding a time offset modifier to the grease pencil object,
enabling custom range and setting end frame to the length of the grease pencil animation.

Only problem now is that all the boids loop in unnatural unison, but I guess I'll open another question for that.