In a couple of my M&P pistol armorer classes (5 of them, plus a Shield class) we were told that the factory fires 15 rounds through each M&P before they're shipped. Last I was told, it was done using factory test mags (not the new ones shipped with the guns), and it was done using 3 test mags loaded with 5 rounds each. They don't clean the guns.
I have no way to know anything about the particular gun you bought, or the dealer who sold it.
FWIW, I've bought new S&W's directly from the factory under their former armorer purchase program (shipped to a LE FFL dealer, of course), and some were dirtier than the one in the pics.
Oh yeah, the "sharpie" lines on the mag followers. The light colored followers get dark ink color lines, and the dark color followers get light ink color lines, so they're visible (obviously).