Don't know much about e46 touring models but 167000 miles + could be troublesome in the near future.
for $4000 as a budget maybe try other vehicles that can provide longer durability and better reliability? (Nissan Altima, Hyundais are pretty cheap, Maxda 3, or even Honda Civic (Civic as a last option))
I'm sure your niece wouldn't mind what car she gets, however if you want to get a BMW for her, drop the price to what you said ($3500) I wouldn't go any higher than $4000 if you really like the car. Make sure to get warranty somewhere.
Best of luck