Not clear. Your output's first and third block have four lines, and I can't see a pattern on which to decide which lines to keep and which to remove. Pls be more specific.
awk '
# c print line counter
# d skip line flag
# e skipped line counter
{if (++c % 6 && !d) { # mod test for c line count (not 0) and skip line flag set to 0
e=d=0; print # print line reset e set d to 0
} else {
if (++e % 4) { # mod test for skipped line counter (not 0)
d=1; c=0 # set skip line to 1, reset print line counter
} else {
print "\n"$0; d=e=0 # print first line of block with separator, reset print line counter,
# and set skip line to 0
}
}
}' input
awk 'NR % 8 == 1 && NR > 1 {
# Print an empty line separator between sets of 8 input lines.
printf("\n")
}
(NR - 1) % 8 < 5 # Print the 1st 5 lines in each set of 8 input lines.
' in_file