Adding a action between two times, but relying on other variables.

I'm not sure what you mean by "between two times": do you mean times of day, like only operate between 0800 and 1700 or what?