For this sort of code which only runs once a frame it's not really relevant which is faster - the game is doing hundreds of thousands if not millions of operations to draw the screen, so a hundred here or there makes no odds.
As for the local variables, I don't know how AGS's scripting language works internally but generally, there is a pre-allocated "stack" (like a tall set of shelves) and when you create a local variable it is added to the first empty shelf from the bottom. When you leave a function, or part of a function (between {}) any shelves that were used are emptied, by changing the "pointer" to the first empty shelf back to the value it had before you entered the {}. This happens whether you have used local variables or not.
The point is that for 95% of game code it's more important to be legible than fast, because you're not going to make it much faster anyway, particularly if you don't know how it works (like me - I'm just guessing).
Steve
As for the local variables, I don't know how AGS's scripting language works internally but generally, there is a pre-allocated "stack" (like a tall set of shelves) and when you create a local variable it is added to the first empty shelf from the bottom. When you leave a function, or part of a function (between {}) any shelves that were used are emptied, by changing the "pointer" to the first empty shelf back to the value it had before you entered the {}. This happens whether you have used local variables or not.
The point is that for 95% of game code it's more important to be legible than fast, because you're not going to make it much faster anyway, particularly if you don't know how it works (like me - I'm just guessing).
Steve