Wow.. thats one helluva question!
We can write a thousand pages on all the info you requested!
You need to be specific here:
1. What is your budget
2. There's a big difference from a 99 car and a 05 E46. I would say go late E46 as much as possible or jump into the E90 scene if you can swing it.
3. In terms of "avoiding" cars.. There's not much you can do. Each year have their own gremlins and issues and despite your best efforts you might buy a lemon. Such is life. The one piece of advice anyone can give you for ANY car is to avoid first generation cars as much as possible (ie. buying a car in the first year it was introduced)