Yes, no problem at all to fit that engine in front of the trans that came in the 300GD. Now, how long the trans will last is a matter of the condition of the box, your driving style, and how much work you want to do on the trans. Some bearing updates will help it last longer. But with a trans in good shape, today's high quality lubricants, and a sensible head in the driver's seat to make the proper links between hands and feet, it's no problem.
The main sort of trouble is that if you have the 4-speed manual, top gear is 1:1, and with the G's axle ratios, your top criosing speed on the highway will be limited to about 70 mph. (update your info to include your location) The best solutionall around is to get one of the manual transmissions that MB supplied with a turbodiesel in the G, since those are designed for that engine's power and torque curves, and have proper ratios for keeping that engine happy in a G. There are other ways to go, of course, like changing diff gears and such. At the end of the day it comes down to your own usage, what's best for you.
BenzWorld.org forum is one of the largest Mercedes-Benz owner websites offering the most comprehensive collection of Mercedes-Benz information anywhere in the world. The site includes MB Forums, News, Galleries, Publications, Classifieds, Events and much more!