First of all, thanks for your answer! I was visiting a friend of mine these past few days and didn't see your reply here, so sorry for that delayed answer.Create a timer that will activate every 30 seconds:
int Timer; // out of AI
if (Timer == 0) {
// other code here
Timer = 30 * 60; // 30 seconds * 60 ticks (60 ticks = 1 second)
}
Timer--;