Ehhhh, I mean yeah a Thompson will do what it's supposed to do, but there is a reason it's not still standard issue, mainly to do with the fact that it is an obsolete weapon. Not useless, but certainly lacking many of the incremental improvements that have been made in the field of firearms in the near century since the Thompsons release. Like this is a nearly 100 year old design. We have made some improvements in the field since.
And really this is all tangential, because regardless of if a Thompson can compete with an M4, you are limited to the Thompson, and it has been made as hard to get as legally possible (and many would argue flatly unconstitutional).
Edit: The design of the Thompson is in fact over 100 years old, and the firearm has been in production for 101 years for clarification.