Your going about this all wrong...

You need to restructure your code differently.
Your First code should have all your include scripts.
You don't need any other scripts attached to other levels.
Except for trying levels in Wed you could
attach a scipt to say level2
called Level2.wdl
this script simply contains

include <Mainscript.wdl;

Without knowing the full working...
I can Say I could accomplish your goal With a simple
Var defined in Mainscript.wdl


VAR Majic power,
Var Majic power = 0;


Then In A action on your player restore code
in each additional level..
add a function:

function Majic power update()

{
Majic power + = 1;

}


Have another function running somwhere:

Majic power check()

{
If Majic power = 12;
Majic power event() // awesome function defined elsewhere
}



Hope that helped... been down a similar road.
I know when you get into multiple levels you
have to start thinking different!