If you have a Midi Program that uses Controls and Pitches, then put those 2 Midis together and put a Control No. 111 at the point, where you want to loop the Midi (most likely the start of where Midi 2 sets in) The control has to be in Midi voice 1.

But I have a question: How long is this small break exactly? Is it just a few ms or is it something like a second or longer?
If that's the case then just look if midi 1 has a little pause at the end and delete that pause.