How to drill your chess opening?


I find that the method you describe is excellent for getting the thematic moves of an opening into my head but not so good for learning specific lines, but much depends on having worked out one's own individual psychology and what types of practical step make things stick in one's own memory. Much like there isn't one set 'best' way of revising for an exam. A phrase my wife once coined is, "One size fits nobody" and I suspect that that is a valid axiom here. I personally find that specific lines stick best in my head if I have played them over several times on a physical board; thinking them over as I go; and making old-school pen-and-paper analysis notes. But then I'm over 50 and grew up in ye olden pre-computer days of yore, which has probably conditioned how I learn. As inscribed on the temple of Apollo in Delphi, "Know thyself".

You may also want to weight your study according to how often a line might come up; either by database stats or your own. If you are a 1d4 player there is no point in spending 25% of your study time on a line against the Dutch. (I mention this because I have been this morning on my lines against the Dutch, and so probably won't for a few months again...)
But there is nothing like studying after a game, and in particular the ones we lose...

It kind of depends on the position. But here are a few things I've done... I don't know if this is the ideal approach it's just how I've approached things -
a) I also use this PGN method you describe... I try to divide up the opening into distinct variations and I have a PGN for each variation. I think I have 25 or so PGNs for the sicilian currently. For main lines I may break it up into multiple PGNs, for sidelines it'll be just one.
b) I've only focused deeply on one opening at a time. Like I've spent the last 2 months just studying the sicilian, and it's so complicated that I'm ignoring everything else. I plan on doing this until I'm basically done studying the sicilian.
I think it's also important to focus first on your main lines that you will most commonly get. So my defense to e4 is probably going to be the most common line therefor I started with it.
c) for memorizing lines... I think consistency and time is important. Reviewing your lines after every game you play.
Something that's helped is I've annotated the games with comments summarizing the ideas behind a move or a position. If something's just a bunch of raw data it's harder to remember, whereas if you have a grounding in the concepts it gets alot easier. The concepts also increase your flexibility as a player, so if the opponent deviates from your algorithm at least you have some idea of how the position works where you'll be able to think critically about your opponents deviation OTB and punish it. And even if you lose your algorithm you'll still remember the ideas and be able to play well. And when you review your PGN you'll be reading the comments and actually reviewing the ideas. Sam Shankland does this also.
Sometimes it takes digging and deeper investigation to figure out what the core essence of the position is and to distill it into a concise comment that will stick with you.
d) I've made efforts to not go too deep into lines I don't think will be common. You have to know when to stop your analysis and when to go deep. Like in some anti-sicilian sidelines I may go 8-10 moves deep... for the mainline open sicilians, in certain cases I've gone as deep as 15 moves.
For a related point - usually it's natural to study openings in an algorithmic way. Most of the time this works and will get you out of the opening... But with certain mainline openings, which are basically whole-board nonlinear positions, the opponent has 7 viable moves, then 7 viable next moves, and so on... you can't really play them just algorithmically. What I've found useful here is to explore the move tree maybe 3-5 moves deep, but focus very heavily on the ideas of each move. So annotating the games. Then when the ideas stick with you, even if you forget the opening or once you exceed your move tree... you'll have developed an understanding of the position and you'll still play fairly well.
Something else that can help in these sorts of complex positions is to compliment your study with a few model games. Both engine and high level human games. That way you get some feel of how the position may unfold as it goes deep. Along these lines, something I've done is when I reach the end of a line... maybe move 12, it's the end of where I want to memorize.... I'll just add another 5-7 moves following an engine, not meant to be memorized just a little model game showing how the position might unfold. So presumably as I study I'll just absorb these different ideas from these little model games and I'll develop an intuition for playing deeper.
Overall though I think it's a very long-term effort to get good at the opening, which will involve repeated mistakes and refinements and reviewing the lines, etc..