not fully checked, but the patch does what you need.
edit for the ones who are too lazy to open the patch:
the solution proposed is not use the randomspread not as values directly but as differences between the slices.
since the posted rule is to disallow subsequent slices with a difference of ±2.
so the randomspread ranges between -3 and 3, ±2 are switched out and replaced -> integral -> mod to keep the values between 0 and 3