Welcome to United Bimmer
First, all three of the cars your looking at have known cooling system issues. Ask for a service history of the vehicle. If it hasnt been done yet, several components of the cooling system will need to be replaced. As well the V8's arent as reliable as the I6's, and over time require more care. All three cars are DIY capable so you can fix almost all the problems yourself.
Starting with the E46, known issues incluude parts of the cooling system being made of plastic which becomes brittle and cracks over time. The thermostat housing, coolant expansion tank, and water pump are all failure points around the 90-100k mark. Its not that expensive to fix, and runs about $500 to get the upgraded components to prevent failure. One other issue is some E46's were made with an LF20 Power steering pump. This pump had a design flaw and will eventually fail. You can easily upgrade to an LF30 pump which is a higher pressure pump and provides a better steering response. I just did this for a friend in his 2004 320i and it took less then 3 hours.
The E39 has a few more known issues then the E46, including the cooling system. One of them bieng the Self Leveling Suspension. If the car is equpped with it, it can be a pain to have it fixed should problems develop. In addition the V8's are known for oil leaks at the back manifold gasket. Easy fix, but a pain to do because of tight space.
I would nix the second one. You say things are "loose". To me this indicates less then proper service work, or it was beat on. Out of the three i would choose the E46. Im a sucker for red, and it seems to be in better shape based on your description.
Regardless of what car you choose, their is an absolute wealth of information available on both cars. Their is more aftermarket support for the E46 if your interested in modding it.