What I did was write a python script that does this:
1. Create a thread with a socket that when connected to will return the value of the Rebootcount variable,(this is used to check that the script is running)
2. Sleep for 120 seconds to allow the system to get up and bring up IPSec on one of the interfaces,
3. Ping the inside interface of the Cisco (inside the vpn) twice, if at least one ping is successful, call that complete and reset rebootcounter to zero,
4. If the ping fails, increment reboot counter by 1,
5. IS reboot counter 4 or more, Yes reboot, no continue,
6. Sleep for 30 seconds,
7. Go back step 3.
This has solved the circular negotiation issue that sometimes happens as the routers will reboot themselves without us having to SMS the reboot command.