I'd replace the radiator and see if it is OK. If it is then I do the rest of the cooling system, if the radiator has gone the rest will follow!
The v8 engine runs at over boiling point, the must be pressure in the system to stop the coolant boiling. If the pressure is released then the coolant will boil and the temp will spike up. The spikes in temps you saw were probably early signs of your rad failure (it releasing the pressure through a small crack). I've seem similar issues with mine when expansion tanks have failed.
The v8 isn't as bad as the i6 for issues caused by overheating luckily and head gasket issues are prey rare. So unless you ignored the issue and ran it for a while in the red it should be fine.
Stay away from the in cooling systems sealants, they'll ruin the cooling system. I'd only use on a car that was terminal it make it last week or two more....
An e39 is like a beautiful wife, needs constant attention, lots of money, lets you down at the worse times but you’d never be without it.