Scot, even if you haven't got your car scanned yet you should make sure the battery voltage and connections are OK as the E39 is very sensitive to low voltage/bad battery or charging problems, which can cause intermittent problems. If the voltage is OK then we can rule that out.
Use the following instructions to unlock the on board diagnostics. Use the tests when you experience the problems, it may or may not help with this but I use them to rule things out. Test#9 for the battery voltage, Test#7 for the coolant temperature are commonly used. I don't use Test#21, I don't take a chance with that one.