That'd be an E28 524td? I think it is an M20 based engine, if so any M20 based gearbox should fit, but check the gear-ratios will be the same as the original box, else it will be a nightmare to drive. With any luck, the diesels only had different final-drive ratios to the petrols, but I doubt it...
May be better to find someone to fix the box you have?