GO to LKQ or Cophers U pull. They will have the parts there used in the yard.. Last time I was there there were 3 BMW e34 525s They should have the same TBS.. But the Air Flow meter - wire may vary. Just look at the pins and plug to match.
The First thing I would do is Unhook the Oxygen sensor, this should put it in a loopback mode. I have had a bad OX sensor cause the car to stumble in the past.
I would also go to Harbor freight and get a fuel pressure guage.. So you can check the pressure in the fuel rail and check the return line. I have had the same symptoms due to to much pressure. the return line was kinked .
When all else fails there are some good shops in Tampa that are very good with BMWs. I just had to take a car to Cars and Concepts for a Wiring-ECU reprogram.
__________________