Efficient correlation of a low duty cycle training sequence
One way to approach this would be to have a bank of $L$ subcorrelators, each of which use the corresponding $N$-sample long template. Then, in order to get the effect of correlating against the longer gated sequence, one need simply to sum the outputs of the subcorrelators with the appropriate delays applied. This is equivalent to breaking the long matched filter into a parallel formulation with $L$ subfilters.

For instance, assume the output of subcorrelator $i$ is $c_i[n]$, and that the notional output of the full $ML$-sample corelator is $c[n]$. The full correlator output is just equal to the sum of the shorter subcorrelators, after taking into account the $M$-sample delay between the expected position of each template in the input signal:

$$
c[n] = \sum_{i=0}^{L-1} c_i[n-(L-1-i)M]
$$

Using this structure, for each output sample, you effectively implement an $LN$-tap FIR filter instead of an $LM$-tap one. With that said, if any of these numbers are large (greater than 50-60 or so), it's likely more efficient to use FFT-based fast convolution techniques instead. This method is compatible with that; you would simply use fast convolution to calculate each of the short subcorrelator outputs, then perform the delayed sum as described above. I've implemented this very technique before with good success.

There are a couple other things to think about with this approach:


The OP suggests that some of the $L$ frames may not have distinct patterns from each other. If this is the case, you can achieve some complexity reduction by only implementing the number of unique subpatterns, then tapping the outputs from each subcorrelator appropriately.
This sort of technique can run into issues with scalloping loss if the overall length of the correlator ($LM$ samples) is large with respect to any carrier frequency uncertainty on the input signal. This is inherent with any kind of coherent correlator structure; the longer you correlate (thus giving you more potential gain), the more frequency selective the correlator is (the more loss you have for a given frequency offset in your signal).