After a brief look at your profile this is what I see.
Looks to me that you are using var2 to help regulate the time interval between actions. Problem being once one of the if statements in the final while loop is executed, var2 is reset to the current time. The result will be that the other if statements in the while loop will be false and therefor never executed.
Maybe strip the if statements down to
if (my time interval) then
{
if (my settings) then do stuff
if (my other settings) then do other stuff
.
etc
}
If that doesn't help, I'd need to know exactly what you are trying to do, as I don't have the time to try to decypher your profile.