At a glance, there is no substantive difference between the two. Convince yourself - put your finger on either, they will function identically.
Oh, yes, yes there is.
Your both examples block, that is to say you are stuck in the while loop blinking, meaning any other activity (reading inputs, doing calculations, adjusting outputs, e.g.) is impossible.
We like to let the loop() do the looping. In this case it would mean reading the analog input every time through you loop() function, and with that reading decide whether or not to advance the progress of a pattern that blinks without the use of delay.
And whether to turn on or off M#_NPN
digitalWrite(M3_NPN, HIGH); // Keep M3_NPN high
So it should be no surprise that I next direct your attention to an idea called "blink without delay" - there is an example in the IDE, and a competent enough article if you google
arduino blink without delay
but TBH there are dozens of places to see the same idea, and since it is a bit tricky everyone likes to think she has come up with a superior introduction to the concept. Googling will turn up plenty of various points of view.
Read a few of them, see if something catches hold of you. There is an Aha! moment.