I think, in a Mp3tag export script the visibility of a user defined variable is limited to the current loop block.
And yes, there might be a trick to use a user-defined variable, which has been defined outside of the current loop block.
I remember I have discovered something like this ... once the user-defined variable has been 'elevated' into the 'global loop stage memory' it can be used within other loop blocks.
Sadly I do not know it from my memory yet, how I have done it.
( ... try to find some of my recent export scripts here in the forum. ... ;-))
Hmm, study the attached test export script, maybe you can see how it could work.
20110601.Test.Visibility._puts.mte (2 KB)
DD.20120321.0630.CET