One way to do this is to use isbetween in a for loop, and then unique(, 'rows') to find the groups:
t = datetime({'27-Aug-2020 12:30:13',
'27-Aug-2020 12:39:23',
'27-Aug-2020 12:47:46',
'27-Aug-2020 12:30:15',
'27-Aug-2020 12:39:25',
'27-Aug-2020 12:47:48',
'27-Aug-2020 12:30:18',
'27-Aug-2020 12:39:28'});   % put the data in a datetime
tmax = t + seconds(30);  % determine the 30s offsets from each element
tmin = t - seconds(30);
for i = 1:length(t)   % loop through each element
    y(i,:) = isbetween(t, tmin(i), tmax(i));         
end
yy = unique(y, 'rows')     % each row is a logical vector indicating which element belongs to the same group