Walikum Wasalam,
The E39 is one of the most successful 5 series from BMW. Some say, it is the best and purest 5 series from the recent models from a driving experience point of view.
Typical issues with E39 include its cooling system, so replace its cooling hoses, water pump, thermostat, if they haven't been replaced in last 20,000km.
In addition for a car of this age, go over its transmission service (oil and filter replacement). I would go through its service history and look how frequent it was serviced. Look at any oil leaks specifically.
In the end, make sure you have a trusted BMW Mechanic before purchasing a BMW.