Then File -> Load Script... and choose the lua script for your game version.
Every time you need to save or load a state, hold Shift + (n) or (n) with game unpaused.
This will load the save state to have the script read advances correctly.
For example, Shift + 1 to save a state in slot 1 or 1 to load the state in slot 1.
Troubleshooting
Error: attempt to call a nil value (method 'setWatchpoint')
Make sure to use the development build of mGBA linked above. Other versions of mGBA will show this error.
Error: attempt to index a nil value (global 'emu')
Make sure you have loaded a rom before attempting to run your lua script.