There are two ways to run these pre-configured scripts:
Using with Boot disc
Create a VM normally and capture the image after adding all configurations, Then you can use the image for launching multiple instances. Which will be loaded with your script.
Using Startup file uploaded in Google Drive
Here, you need to upload the startup file and access that file and read the content of it. For implementation information, click here.
For additional information, refer to this GCP training.