Since they are in different data rows, I would use shared variables in a formula. There would be a couple formulae. 1 would reset the variable at the change of a group (probably an employee's id and date) and 1 to calculate the time difference.
The calculate formula would look something like:
shared numbervar timeOut;
local numbervar lunch := 0;
if timeOut = 0 then
timeOut := {timeout field}
else
lunch := {timein field} - timeOut;
if lunch > 0 then
lunch
else
0
You should be able to sum this, if not, it is just another shared variable to calculate the total lunch times...there is much that can be done, but this is the basis.
Hope it helps