1. Be very careful when buying from your average used car lot. Get a PPI to make sure you're not buying lots of neglected maintenance and accident damage.
2. $17-18K definitely seems doable just based on a quick search I did around me. Like this for example. And this one.
Current: E60 535i M-sport
Prev: E90 330i, E93 335i, W212 E350 Bluetec