There are many pros and cons between the two airsoft guns. Really these two along with an AK-47 are guns in which parts/accesories are common.
Pros M4:
Parts
V2 Mechbox

Feel
Length
Lighter Weight
Rail Built in
Adjustable stock (usually)
Sights (easy to aim)
Adaptability
Cons:
A pain for left handed people
Plastic parts
Everyone has them
Stock (can be wobbly)
Weight (somepeople complain about the weight)
MP5 Pros:
Lightweight
Compact
Comfortable
Parts
V2 Mechbox

Kickass look
Adaptability (for your needs)
Cons:
Size
Sights (i find it hard to look through compaired to a M4)
Range (not that long of barrel so not as long range)