OK, I see.
You could create a Sampler and shuffle the paired indices.
We would have to take care of invalid indices, e.g. between sequences ([1_4], [2_1]), which should not be possible.
I’ve created a small example:

class MySampler(torch.utils.data.Sampler):
    def __init__(self, data_source, invalid_idx):
        self.data_source = data_source
        self.invalid_idx = invalid_idx
        
    def __iter__(self):
        indices = torch.arange(len(self.data_source))
        paired_indices = indices.unfold(0, 2, 1)
        paired_indices = torch.stack(
            [paired_indices[i] for i in range(len(paired_indices)) 
                if not i in invalid_idx])
        paired_indices = paired_indices[torch.randperm(len(paired_indices))]
        indices = paired_indices.view(-1)

        return iter(indices.tolist())
    
    def __len__(self):
        return len(self.data_source)


class MyDataset(Dataset):
    def __init__(self, data):
        self.data = data
        
    def __getitem__(self, index):
        x = self.data[index]
        return x
    
    def __len__(self):
        return len(self.data)


data = torch.tensor([11, 12, 13, 21, 22, 23, 31, 32, 33], dtype=torch.float)
invalid_idx = torch.tensor([2, 5, 8])
dataset = MyDataset(data)
sampler = MySampler(data, invalid_idx)
loader = DataLoader(
    dataset,
    batch_size=1,
    sampler=sampler
)

for x in loader:
    print(x)

Using this approach you would have to make sure to sort the data and calculate the invalid indices (sequence changes) before.
Let me know, if that works for you.