W - 4 door sedan (or small suv)
V - Long wheelbase sedan
X - Long wheelbase SUV (i.e. X164 = GL, X204 = GLK)
C - Coupe
S - Wagen
R - Roadster
M - Gasoline Engines
OM - Diesel Engine
Where did you actually get the "S - Wagen" part? If it was a spelling mistake and you meant the English (American) word "wagon" instead, I would understand but the German word "Wagen" refers to a sedan car. I don't actually know which German word does the S come from, wagon is Kombi(wagen) typically.
The list includes some other letter combinations like CL which does not refer to a CL but like the small C-class Sportcoupe (which you may not have in the US).
The there is "A" which refers to "Cabriolet".
The most accurate source for these I've found is not from MB documentation (the W, S, C etc. codes are not used a lot in official documents but more complete body codes like 211.222 which is an S211 diesel wagon as opposed to a 211.022 which is a sedan W211) but here: Mercedes-Benz Baureihenverzeichnis
The "M" should simply come from "Motor" while "Ottomotor" is a diesel.
I missed the notation MM described but learned it a bit later from another post. This combination of commercial names and technical names from above appears to be used in the US. Like the commercial "E320" combined with the W or the S which one could easily interpret the opposite if not familiar with the letters as described by joshuajeeper and others. I guess the problem comes from the omission of the "T" letter from the commercial name of current wagon models?
But how can you explain that a G500 can be a cabriolet, a stationwagen long or short wheelbase and all are called "W"?