The 1996 to 2003 E39 might be the best 5 Series BMW will ever make. A good looking, reasonably modern car, it's a better driving Bimmer than the two generations that replaced it. It's not that the newer cars are bad, just that priorities have changed. People want cars with sat-nav, Bluetooth integration, and in-car infotainment. Driving has become secondary to whether or not you can stream Pandora from your smartphone or get directions for dinner.
For $15,000 you can buy anything from a BMW 525i to an M5. Any choice should be a good one, but the M5 has the potential for appreciating in value, like the older M5s and M3s are currently doing. The 540i is also a good alternative to the M5, with it's V8 engine from the 7 and 8 Series but without the Red Bull laced edginess of the M. Either way you go, you'll get a focused driver car, with the practicality of a Honda Accord.
The only drawbacks to these cars are age related. Even the newest one is ten years old, and like all older cars, what you get is largely based on how the car was taken care of. When something breaks, parts are usually readily available but the repair bill will be expensive.
Thee biggest challenge of owning a BMW, any BMW, is the yuppie factor. There was a time that a BMW was the required vehicle for young urban professionals. It was a status symbol, like a Rolex watch or Hugo Boss suit. That perception exists today, can dampen the inherent baked-in goodness of the car, but if you can tolerate that perception, or welcome it, the E39 makes a good all around car for an enthusiast on a budget.