So when W is pressed, you call function "add" 3 times. In "add" function you call "update", so it goes add->update->add->update->add->update. These 6 function calls are performed one after another, but all in one tick.
Inside the "update" function you check if Item with ID exists, if not, you create it. Object instance is not created immediately, you need to wait till the next tick before you can pick it by its instance variable. That's why your code works differently when you add "Wait 0" before function calls - it allows time for Item to be created.
It's possible to fix this without "Wait 0" - for example, you can set some flag in the array when Item is created, but I don't really understand your code, so can't help with this.
Also, if you need to see the order in which events are executed, add Browser Log action to your functions. Press F12, and you will see log messages in console. It's a powerful debugging method, you can output variable values, array contents, function parameters etc. and see how they are changing.