The M4 has an advantage or two.
Easier film loading and self resetting film counter. It also has a frame for 135mm lens, no big deal at (to me)
It also has a more modern rewind knob with crank handle.
The M2 has to have the take up spool removed to load film unless it has a rapid load adapter in it.
Framelines are 35/50/90mm......... M4 adds 135.
M2 has several variations. Lever or button rewind, and with or without viewfinder preview lever. The early cameras had the button, no preview, no self timer and a Leica sync plug. Adapters for the plug are inexpensive.
It would be easier for you to see the differences if the cameras were side by side.
In either camera, Look at the screw at the top of the lens mount. It should have a black seal usually with a script Leica "S". Look at the curtains with the back open, look for pin holes or wrinkles. pinholes are $$$$.
Check the shutter speeds, if the slow speeds hesitate or hang up that's $$$, rangefinder alignment, both vertical and horizontal. Vertical is easy, move the rangefinder lever in the camera body and while looking through the finder the moving rectangle and stationary one should not have a slight"shadow". Horizontal needs to have a known good lens installed to check infinity.