So you are:
- Rezeroing the robot after battery exhaustion.
- Referring to UWRIST and DWRIST and there is no evidence of this in your program.
- No idea how to make a backup.
- Applying modifications without making any sort of backups.
I am now very scared indeed.............
This is not how you teach the HOME or HOME2 positions.
You should read the AS Manual.
Now I am very scared...........