Expect Scripting Loop Argument Desperately Needed!

I am trying to create an Expect script that does the following:

1) Telnets to an IP address and logs in with user ID and Password

2) Issue a CLI command to the server that will output data of which I am particularly interested in a DS1 clock 'Slips' value. I want to be able to keep issuing the CLI command..........wait say 5 minutes...then issue the command again...wait 5 minutes....issue it again........and if the clock 'Slips' value is increasing, I want to input another CLI command to change the clock source which prevents the equipment from losing clocking and having to be reboot the server to restore call processing.
3) this script will be run randomly using crontab.

I am obviously using Expect/TCL off a Linux box. My current script is able to Telnet to the server and login successfully, issue the CLI commands and change the clock source accordingly. The crontab also works.
The issue is parsing this SLIPS value and putting this value in a loop to see if it is in fact incrementing over the 3 or 4 CLI command queries and if so, I need to initialize the clock source. I have no clue as to how to make this loop command syntax using Expect scripting.

So again, once the CLI is isssued the first time, there will be a SLIPS value within the output, that needs to be saved, .....5 minutes later....the same command is issued again to see if the SLIPS has increased.......5 minutes later....same command issued again....and if SLIPS has increased 3 times in a row after every inputted CLI command...then I need to issue the CLI command to switch the DS1 clock source.
Again, this script will be ran again using crontab.....likely every hour.

Here is my script contents to date:

#!/usr/bin/expect
spawn telnet 127.16.10.99/r
expect "Connected to 127.16.10.99.\r"
expect "Login:"
send "tester\r"
expect "password:\r"
send "esso123"
expect "Spirent#"
send "st t1 stat sl6di2"
# the above command outputs the following info on terminal

DS1 Stats:

Slot SL2/DI8(PRI)
StatusLayer1 Active
StatusLayer2 Active
FramingErrors 6
PathCodeViolations 0
LineCodeViolations 22439
Slips 2
DchTxFrames 18260
DchTxOctets 72765
DchTxFrameUnderrun 0
DchRxFrames 17816
DchRxOctets 72765
DchRxLenViolations 0
DchRxAbortedFrames 0

#what I need to do is take note of the 'Slips' value - currently is shows value of 2

# so I need to create a loop statement that stores this value and then sleeps for 5 minutes.......then issues the CLI command to the system again and checks Slips value and check if it has increased - if it does - sleep 5 minutes and then issue the CLI command again......if it has increased again.....then I will need to switch the clock source. Note - if the Slips value is not increasing after the CLI command, then i need to say within Loop statement to exit this procedure.

Any help would be greatly appreciated.....searching Google for specific examples pertaining to this scenario has been fruitless. I have the Expect manual by OReilly....and it hasn't been useful to me regarding this looping function needed.

Thank you for taking the time.