What do you want to do with the '?chew?' entries?
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/728984/bat11.xlsx';
opt = detectImportOptions(filename);
opt = setvartype(opt, 3, 'categorical');
T = readtable(filename, opt);
TT = timetable(ident, 'rowtimes', times);
NT = retime(TT, 'regular', @(I) nnz(ismember(I,'Chew')), 'TimeStep', seconds(10));
If you look through the file from the beginning, you might be led to expect that the values should mostly be 0. However, when you get to row 20010 then the times reset and start to appear more densely, and there are no non-empty column 4s until that point.
Your outlined algorithm would not have worked, as you did not account for the possibility of time being reset.
I do not understand about your column 12 / column 13 desired outputs. Column 13 is expected to contain the count for the block of 10 seconds, but only for the entries where the time is exactly a multiple of 10 and should e empty otherwise? And column 12 should be empty on the places where column 13 is filled in, but on the other lines, it should be a running total of the number of times something other than 'Chew' was found ?? But if so then how do you want to handle the fact that time reset at 20010 ? Or the fact that none of the timestamps in column 10 have seconds that are exact multiples of 10 ?