Well you could try however I don't know if this'll work this:
30005,OMG_Weapon,OMG Weapon,4,1,,1,10,,1,0,0xFFFFFFFF,7,2,2,1,1,0,1,{},{while(1){misceffect 31; sleep2 2000;}},{end;},{}
but this here, your first script should work just fine:
30005,OMG_Weapon,OMG Weapon,4,1,,1,10,,1,0,0xFFFFFFFF,7,2,2,1,1,0,1,{},{set @w, 1; while(@w == 1){misceffect 31; sleep2 2000;}},{set @w,2;},{}
http://rathena.org/wiki/while for more info