The Lua tools
These tools work through MAME's Lua console. input presses one of the board's inputs, lua runs a script of yours, and throttle sets whether the machine runs at real speed.
The console runs a line only when the machine moves: once a frame while it runs, and once each time it stops. A line sent to a stopped machine waits for the next step or frame. That is why lua steps the machine once, and why a throttle asked while stopped is not applied yet.
How input gets into the program
input sets a named field of one of MAME's input ports, inside the machine, keeps it set for the frames asked and clears it. No key is sent to the emulator's window.
An input that was sent is not an input the game took. The reply reads the port back as the field is let go: active says the port showed the press, not what the game did with it.