Basically you can say:
If you want a variable to stay the same for some time, use this.stuff, if that's not needed or you want to use it also on other NPCs, you use normal variables.
For example, hiding 10 showimgs ...
NPC Code:
for (i=0; i<10; i++)
hideimg i;
... can be done with normal variables (less typing work

and looks nicer), but a movement using for-loops...
NPC Code:
for (this.i=0; this.i<10; this.i++)
if (insert complicate onwall check) {
x += vecx(dir)*0.5;
y += vecy(dir)*0.5;
sleep 0.05;
}
... would need to be done with this.vars, because some other NPC would probably use the same variable for his stuff and confuse the moving one.
A switch for example...
NPC Code:
Switch:
if (washit) {
switchhit = true;
setimg insert switch image;
sleep 5;
switchhit = false;
setimg insert other switch image;
}
Door:
if (playertouchsme && switchhit==true) {
hide;
sleep 3;
show;
}
... would need to be done with normal variables because the other NPC is checking it.
And always, all variables (besides NPC or playerstats (All stuff you can check with npcs/players[index].blah)) are always local and not sent to other people (unless it's a serverside NPC of course).
Bash me if I am wrong, but I think I am not.