schlangster, you seem to use quest stage scripts a lot; declaring local variables in them has never given you trouble right? Just wanted to double-check with someone who has worked them hard that there's no issue like dialog result scripts before I start declaring local variables in them.
No, I never had any issues with local variables in quest stage scripts.
Edit: Until now

There's an incompatibility between Arwen's MedTec esp and Project Nevada, which causes a crash that looks like an infinite loop if both mods are loaded together. On side of the MedTek module, the crash happens because it attaches a script to the player. If that script is removed, everything is fine. I made a workaround, which would use setScript to attach the script, but I think Arwen did some testing on that patch and the script did no longer work as intended when attaching it like that.
Anyway, so I was curious which part of PN causes the hang. After disabling all features, it would happen when the visor overlays are enabled. And in there, it was the call of a stage function:
; Remove all effects; Local Varsshort iref effectprintToConsole "p0"set i to 0printToConsole "p1 %.0f" ilabel 1if i < PNxCVisorVisionEffectCount set effect to listGetNthForm PNxCVisorVisionEffectsISFXList i ; Remove Effect if effect != 0 if IsImageSpaceActive effect == 1 rimod effect endif endif set i to i + 1printToConsole "p2 %.0f" i ;goto 1 ; commented out because otherwise it would crashendifprintToConsole "p4"setUIFloat "HUDMainMenu\_PNxVisorColorRed" 1.0setUIFloat "HUDMainMenu\_PNxVisorColorGreen" 1.0setUIFloat "HUDMainMenu\_PNxVisorColorBlue" 1.0
After commenting out the goto 1, the crash is gone, so that's where the infinite loop was happening. The lines that are printed to the console are p0 and p4. p1 and p2, which should contain i, are omitted, and I guess the same happens to i++. For some reason i seems to be corrupted when the script is attached to the player.
I don't this this is the only stage function this happens to, merely the first I discovered. Oh, and the player script for reference:
scn ArwenWeaponInjuryScript ; NV Med-Tec Module, version 1.9 - by Arwen;object script ; updated 03/10/11, To test scripted values/modifiers: printc "TimeScale is: %g" TimeScale;ArwenArmorLevel global, set in Health script: from 0 to 9: ;0AR:0AL; 6AR:1AL; 12AR:2AL; 18AR:3AL; 24AR:4AL; 30AR:5AL; 36AR:6AL; 42AR:7AL; 48AR:8AL; 54AR(and up):9ALBegin OnHitWith ArwenBulletWeapons if ArwenMedTecOn set ArwenWoundLevel to ArwenWoundLevel + (1.0 - ArwenArmorLevel/15) ; AL9=0.25, AL2=0.83, AL0=1.0 ;set ArwenBulletLevel to ArwenBulletLevel + (1.6 - ArwenArmorLevel/7) ; AL9=0.31, AL2=1.30 AL0=1.6 showmessage ArwenInjuredMessage ArwenWoundLevel ArwenBloodLost ArwenTraumaLevel ArwenBurnLevel ArwenInfectionLevel endifEndBegin OnHitWith ArwenCuttingWeapons if ArwenMedTecOn set ArwenWoundLevel to ArwenWoundLevel + (1.2 - ArwenArmorLevel/9) ; AL9=0.2, AL2=0.98 AL0=1.2 showmessage ArwenInjuredMessage ArwenWoundLevel ArwenBloodLost ArwenTraumaLevel ArwenBurnLevel ArwenInfectionLevel endifEndBegin OnHitWith ArwenBurnWeapons if ArwenMedTecOn set ArwenBurnLevel to ArwenBurnLevel + (1.2 - ArwenArmorLevel/9) ; AL9=0.2, AL2=0.98 AL0=1.2 showmessage ArwenInjuredMessage ArwenWoundLevel ArwenBloodLost ArwenTraumaLevel ArwenBurnLevel ArwenInfectionLevel endifEndBegin OnHitWith ArwenSevereBurnWeapons if ArwenMedTecOn set ArwenBurnLevel to ArwenBurnLevel + (1.4 - ArwenArmorLevel/8) ; AL9=0.275, AL2=1.15 AL0=1.4 showmessage ArwenInjuredMessage ArwenWoundLevel ArwenBloodLost ArwenTraumaLevel ArwenBurnLevel ArwenInfectionLevel endifEndBegin OnHitWith ArwenTraumaWeapons if ArwenMedTecOn set ArwenTraumaLevel to ArwenTraumaLevel + (1.3 - ArwenArmorLevel/7) ; AL9=0.14, AL2=1.0 AL0=1.3 showmessage ArwenInjuredMessage ArwenWoundLevel ArwenBloodLost ArwenTraumaLevel ArwenBurnLevel ArwenInfectionLevel endifEnd