I would go with s500. The 1996 740 has a major problem with the engine. BMW even has had a recall on the engine ( Not sure if it is still in effect) where they will replace the whole thing if the car has less than 100K.
furthermore, I always though that Mercedes has better resale value specially for the top of the line sadans.
Hopes that help.