The motors are usually pretty cheap. Not many people really liked the later e36 M42; swaps are common. Check on BF or R3v to see if anyone is swapping, make them an offer. I wouldn't pay more than $300ish for a complete motor unless it has really low mileage, a recent timing chain overhaul, MarkD chip, COP kit, etc. I'd look to get the harness, tranny & DME as well.
When you're looking make sure you check compression, condition of cam gears and crank end play. The M42 has a pretty weak thrust bearing, early tensioners let the chain stretch, and the idler pulley tends to die. Later M42's fixed all those problems. There are detail differences between the two or three models of M42 (mainly the accessory serpentine belt drive & intake manifolds), but you shouldn't have a huge amount of trouble installing a later motor.