To explain it better the contents of aml_autoscript are saved to the env partition when pressing the reset button.
This partition is read by the bootloader at every boot up and contains the boot commands, that is why it is only needed once because once our modifications are saved then they are there forever unless you do a factory reset.
aml_autoscript contains some basic commands to tell the bootloader to try booting from USB/SD first before the eMMC.