I sample clip would help a lot, but without I’l try to give some advice.
Generally in music, you shouldn’t confine yourself to bars or measure counts but in the world of EDM it is important as it maintains the groove and pace of the track. More so, it can confuse the most important people, the dancers.
That being said, the Head-Tail approach is pretty handy. essentially what it is, is a melody/riff that has a “head” which repeats for 3,6, or seven bars. with the 4th, 7 & 8th or just the 8th bar being the variation.
Examples:
Bar: 1 - - - 2 - - - 3 - - - 4 - - -
____Head Head Head Tail
Bar: 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - -
____Head Head Head Head Head Head Head Tail
Bar: 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - -
____Head Head Head Head Head Head T - A - I - L -
I’ll just take a wild guess and assume that Bar 5 of your melody is the “Tail” so to speak. If you can re-arrange it to fit in one of the above examples, hopefully it will fit better. The key is to make it seamless and one bar should move smoothly into the other. It should also make sense. Don’t just cut up the melody and squeeze it in, otherwise you’ll have an illogical mess.
A good example of the “Head-Tail” form of arrangement is the song Enter Sandman by Metallica. Off the top of my head I think it fits the 3rd example.
Hopefully this helps, again, if you are able to load of a sample, maybe with just a 4 on the floor kick underneath so that we get some bearing as to how the phrasing should be I’m sure many others here will be glad to help.
Chev
Note: Formatting on the quick response is pure shit, the heads and tails should line up with the bar number but I give up trying to get it perfect.