Hm - I wouldn't quite use the rand() function for this type of task.
Using the rand() function, you will only generate a random item; however you will not be able to use the output of this function to then create an IF statement for the correct response that the 'time' column uses for a specified trial. You may however be able to use the WGR, BGR, and stimlist randomization functions to complete this task. More information on these specific functions can be found listed below:
WGR - http://www.empirisoft.com/directrt/h...hin_groups.htm
BGR - http://www.empirisoft.com/directrt/h...een_groups.htm
Randomized Stimlists - http://www.empirisoft.com/directrt/h...ectrt_stim.htm (head down to the section with '$' or '%')
Please let me know if you need any assistance with setting up this task.