Fair question. But its is strongly advisable that you don't go about this the way that you are currently attempting/envisioning it. The reason to avoid your approach is that it requires entering your password into a text file that could be read by other users/attackers. Now, you could set the file to 600 permissions so that it can only be read by your user (and root), but I'm not sure if the scripts sub-commands may be logged somewhere, making your password again available to potential attackers. I suppose the real question is, why do you need the script to log in as root automatically?
Is it an automated process, or is there some other reason you can't simply respond to the password prompt that is presented when running the script as is? If it's an automated process, you should simply remove the sudo line and add the script call to the root users cron. There is tons of documentation on how to set up cron jobs available by a simple google search, but you can get started with this)
Furthermore, this is a script that simply calls another script. You should probably just make run-server.sh only executable by root, then simply use sudo su
to log into root, then run it with /my-server/bin/run-server.sh
. Again, you could add this to the root's cron if you need to automate it on a schedule.
WARNING: Don't script this, and especially don't type it on a command line (it will be logged)
echo 'PASSWORD' | sudo -S /my-server/bin/run-server.sh