I think first you would need to give the EA some point of reference of time.
When do you want to start the timer? For how long each time do you want the time check to continue?
Sounds something like this;
Establish point of time reference, if no trade, check time, after X time, check for these conditions, if these conditions are met, do this, if those conditions weren't met, do this. If trade...?