Indeed, metadata_startup_script runs every time the machine boots, but you can add set an environment variable (maybe something inside .bashrc like $INIT_RUN=1) the first time you run it, and skip running it when the variable is already set.
metadata_startup_script
.bashrc