Turns out, you can't assign booleans to integers in JS. Try changing the code like this:
localVars.debug=(runtime.objects.fSprite.getFirstPickedInstance().getAnimation("idle")==null?0:1);
And the variable should be local. For global variables use:
runtime.globalVars.varName