Try this
ind = find(abs(data-255)<0.1); % find all '255' numbers
ind(end+1) = numel(data)+1; % add last index+1
for i = 1:numel(ind)-1
ii = ind(i)+1:ind(i+1)-1; % select data between current '255'
data(ii) = sort(data(ii)); % sort data
end