Gotta say, 50 HP is pushing it. There is no way that you need 50 HP for FEL and backhoe hydraulic demand on a machine that size. A 5-7 GPM/ 2500 PSI pump would handle all the loader or backhoe hydraulic speed and power you could use without being too fast/responsive or powerful and that doesn't require anywhere close to that much HP. Even with a loader and backhoe, you would have a hard time getting it to weigh 3000lbs. You will run out of weight, traction and probably drive train reliability before you get anywhere close to 50 HP. I owned a Hinomoto C174 ( basically the same machine as a 5215 and MF 1020) and they are nice, tough machines but they aren't built for 50 HP potential and are really small in all proportions. If you tear up a hard part in the trans or drive train, parts are getting scarce and expensive! I would rethink this and check out some online hydraulic calculators to see what hydraulic demands you actually need for this project.
As far as what would be a compatible engine to repower it, if you want to spend the money and time, you can adapt any engine out there..... I would start with considering what will physically fit in the frame. Next would be what engine has a similar size bell housing ( bell housing size is standardized) so I'd take some measurements of the Deutz's to figure out what number it uses. Depending on what engine you choose, you can make or possibly buy a bell housing adaptor if considering something dissimilar. If there is a need for trans shaft adaptor would be the next step. Then I would figure out what hydraulic pump I was going to use and where to drive it from. I don't recall the gear drive model having power steering so if doesn't and high capacity loader work is in order, I'd consider that modification too.