I have an interrupt triggered by an external accelerometer used to bring my BLE out of PM3. This int triggers a timer. If a device connects, the timer event runs a while loop while a variable "connected" = 1. Outside the loop, I have a connection_disconnected event that sets "connected" variable = 0. Will the connection_disconnected event take priority over executing the while loop in order to bring the while loop to an end? Hopefully this makes sense.
No, it won't, there is no preemptive execution in BGScript, each procedure/even will execute all the way until it exists. If you place infinite while loops conditional to some externally set data then your application will freeze.