Look through the service history to see if the Timing chain/belt has been replaced. I'm not sure what the E46 uses though. I think I'm right in saying that it should have been replaced already, usually before 100 000km.
Also, a manual gearbox is cheaper to repair or replace than the "Fancy Auto" boxes. Drive the car in T-tronic mode and you'll see why I call it a "Fancy Auto".