Please review and critique my script for IOS upgrade activity

Hi,

I have prepared a script for of IOS upgrade activity. Please review and give me your suggestions/scope for improvement, etc
I have prepared the scirpt for pre-upgrade tasks only as of now.

https://drive.google.com/file/d/17iSDtyTp48zIZPi41C-UXXdS3nXck6yY/view?usp=sharing

PRE-UPGRADE TASKS:

  1. Check the IOS version running on device currently. If necessry image is running, skip further steps

  2. Assuming ios need to be upgraded, check if necessary image is already there in flash or not

  3. If image is not present, check if sufficient space is available

  4. Initiate copying of ios image

  5. Ensure image has been successfully copied and do MD5 verification

  6. Set boot statement

  7. write to memory

IOS UPGRADE TASK:

  1. Ensure boot statement is set

  2. take backup

  3. write memory

  4. reload

  5. wait for 30 minute and check if image has upgraded