Would the 4.7 liter from my 1999 Jeep Grand Cherokee fit in an A body?

I don't think the 4.7L would fit but it is just not worth the effort.
Mercedes has nothing to do with the 4.7.
Chrysler would have been better off had they just not done the 4.7 (& 3.7 v6).
The 4.7 is way done on torque from a 5.2, not too noticeable in the Jeeps as the 4.7 had an improved auto trans ( but the poor souls that traded in a 5.2 manual Dakota for a 4.7 manual Dakota felt screwed!).