Stumbled into these while debugging a Papyrus error Pete reported for Forgotten Seasons, but since this is a Dawnguard script I figured we should probably include the fixes here. The issues are as follows:
1. There's a race condition that can result in a "no 3D" papyrus error despite the checks to ensure everything is loaded. This happens when the player leaves the cell while one of the script's two wait timers is running, and the script resumes running after the cell has already detached and unloaded. There are two nested wait timers; an outer 10 second timer and an inner 1 second timer. I replaced the outer 10 second timer with a register for update and unregister during cell detach, (to prevent the engine from holding onto dozens of wait threads), and I added a quick sanity check to the inner wait condition in case the player leaves the cell during that one second window.
2. This one is a little silly, not sure how none of us caught it until now. Both CloseSoundinstanceID and FarSoundinstanceID are defined as CloseImpactSound.play(GetNthLinkedRef(CurrentCastPoint)). FarSoundinstanceID is pretty clearly supposed to use DistantImpactSound, not CloseImpactSound.

Attached Files:
Lighting Script Fix.zip