I agree with Torque - those sensors are sensitive and destructively trigger. Which means they trip the code once their protective covering has worn off. Once that happens you gotta replace them, end of story. Fortunately, they are cheap.
The rest of your fears appear to be driven by lack of knowledge at this point; your car is really not expensive or troublesome to own if you are willing to do your own work AND you stay on top of things and don't let things go too long without fixing them.
Here is the deal, there is one sensor on the front pads (passenger side), and one sensor for the rear (forgot which side). The sensor must be installed correctly so that it will only be abraded when the pad is worn. Proper installation should be fairly obvious once you get a new set of sensors. Make sure you get the little metal clips with them.
Your e-brake does not have such a sensor.
If you are going to own a '98 540, you need to go out and buy the Bentley service manual, available at Amazon for about $109. You should also consult bmwtips.com and 540i6.com, and read this forum and the Roadfly E39 forum every day to educate yourself. Talk to Dave Zeckhausen (http://www.zeckhausen.com)
. Optional but recommended is a Peake code reader/reset tool. Also, start buying those weird metric size tools you never needed before, but will now: 16mm and 18mm combo wrenches, 16mm, 18mm, and 24mm sockets, 7mm hex key socket. For starters.
I hope this helped. I am at 124K on my '99 540/6 and I am enjoying every mile! It isn't CHEAP to keep, but it isn't too bad either.
2006 Honda Odyssey EXL-RES
2006 Honda Accord V6 EX-L Sedan
1999 BMW 540i 6-Speed (Sold to M3UOND on 9/21/06)
1991 Honda Civic Si - Occasional Beater