I find this thread fascinating. I trained as an advanced driver, but never took the test (this does NOT make me any better than the average driver, or give me the right to act superior!), and I consider myself a pretty careful and law-abiding motorist.
I never undertake except in slow-moving traffic jams, and I never middle-lane hog. I do move back into the driving lane (lane 1/inside lane) whenever it is clear ahead, i.e. no obvious slow-moving traffic for a significant distance in front of me. If I need to overtake a middle lane hogger, I admit to moving (when safe) from driving lane, into middle lane, then to overtaking lane, then the same in reverse once safely past them. I live in the hope (so far unfounded) that they will take the hint, and move into the empty driving lane.
I have always been under the impression that undertaking was illegal, except as said above, in slow-moving traffic, but BionicRusty’s comment made me go and look it up. I found this useful guide by the RAC, which is very helpful:
https://www.rac.co.uk/drive/advice/legal/undertaking/