Well the 320d motor IMO is out, IMO
Reason being is that you cant just swap in a computer that came with the 320d due to a incompatibility of the bus on the E36 and the E46. Perhaps the bottom ends are interchangeble, I am not sure...
I am not saying its impossible, just that its going to be more money then what its worth. Also finding a recon is going to be really tough, what exactly is wrong.
IMO, you have 3 options, either rebuild your engine and turbo, or swap in a E36 328 petrol engine, but this comes with its own pitfalls as you will need to change out the entire fuel supply management ect. Your last option is to cut your losses, and part out the car, IE sell the bits off of it and buy a new one.