Depends on circumstances but I am liable to undertake rather than sit there getting my blood pressure up with the potential of doing something stupid once the red mist settles in. It's the safest option in the long run.
:!: This is completely the wrong thing to do and should not be contemplated by anybody under any circumstances whatsoever.
Very quiet road, just me and one other car: I would undertake no messing about, minimum inconvenience for both. Minimum chance of one or the other getting annoyed.
:!: This is completely the wrong thing to do and should not be contemplated by anybody under any circumstances whatsoever.
Moderate level of traffic, Car hogging lane inconsiderately nothing in front of them, nothing behind me: If they pass more than one opportunity to pull in then I would hang back and flash them, if they continue to lane hog then I would pull over to the left at the next opportunity but still hang well back. This usually has the desired result because most inconsiderate drivers will think you are going to try to undertake and move over to block you. While they are moving over I accelerate and am past before they can do anything else stupid. (helps to have a powerful car).
:!: This is completely the wrong thing to do and should not be contemplated by anybody under any circumstances whatsoever.
Same situation but traffic behind me or if plan A failed: I'm afraid I would go for the undertake provided I could do so with a reasonable measure of safety. Not
diving past but using just enough speed to give them time to see me but not be in their blindspot for too long.
:!: This is completely the wrong thing to do and should not be contemplated by anybody under any circumstances whatsoever.
Heavy traffic (i.e. a normal day): I would pick a lane and stick to it, keeping a reasonable distance from the vehicle in front of me.

This is as advocated by the highway code.
Very heavy traffic: As heavy traffic but. Seat back a few degrees, 2nd gear, trickle along leave an oversized gap to allow for variations in traffic speed. If someone wants to cut in front of me then fine, they'll change lanes again in exactly 25 seconds. No point getting stressed about it.
[edited to add disclaimers]