Well, to be perfectly honest, they're all grammatical in that there are no syntactic or semantic issues involved.
With that said, when you're using until it's usually the preceding clause that uses the perfect construction, particularly because until is being used synonymously with before. So to me, I prefer the second sentence in each example.
I didn't understand
until before you explained.
I hadn't understood until you explained.
We didn't disturb him
until before he finished
We hadn't disturbed him until he finished his job.
The past perfect typically indicates that the action occurred before another action, so it's used for whichever action occurred first, With these, it would depend on your perspective; but from a first person perspective, the second is correct.