Script help with Refreshrates();

 
I need to have this script run continuously run until the conditions are met for the email to be sent once and the alarm to sound once. I need to enter the Refreshrates(); command in the correct areas in the script so the bid and the indicators are updated continuously. Any thoughts???
Files: