1997 328 is a great car (I own two of them) but if the one you have needs that much work, you probably won't find anyone who wants it or will take it as trade in. Donating to charity is probably your bast bet.
I cannot suggest an M3 if budget is any consideration, and M3s that are not thrashed command high prices,
In general, it is best to get a BMW that has a few years of production behind it. That means you are looking at a 2004-2005 e46. I own two 2004 e46s. The bad news is that you will spend close to 10k and will likely end up with a car with nearly as many miles on it as the one you are getting rid of. Also, unless it has a fresh cooling system in it, you will be looking at another $1000 in plastic cooling system parts real soon.
If speed is any consideration at all, you absolutely want a 330 rather than a 325. The performance difference is more than the numbers would suggest. I have one of each. Both my cars have the performance package and the ride is pretty harsh. The '97 did not need a performance package to hug the road, but if you got the performance package, it was still a comfortable car, except for those rock-hard seats. On an e46 with performance package, you will find that "smooth quiet ride" is your number one criteria when you are buying tires.
The e46s are slightly lower maintenance as the miles add up. They fixed a number of the chronic flaws in the e36, but the e46s are not built as solidly as the e36. When you are working on them, the components and assembly on the e36 looks more like a Mercedes, while the e46 looks a lot more like a Japanese car.