Dont understand situation.
I suppose 'velocity' is the amount pixels/tick that you move the sprite.
'velocity' can be positive or negative (event 3 & 4).
There is no Y position changed, so i suppose the sprite move only horizontal.
The sprite can approach the tile from the left and from the right. (neg and pos velocity)
We look in the future (x+velocity) and when sprite overlaps a tile, it gets positioned just outside the tile.
Then its velocity is mirrored. So far the basics. As far as i understand them.
When the sprite is approaching from the right (negative velocity) it gets positioned outside the tile on the right side of the tile.
But. When the sprite is approaching from the left, it gets ALSO positioned outside the tile on the right side of the tile (tile index * 32 PLUS 16). Now it is flying trough the tile. The positive velocity is set to negative, as a result it returns (starts moving to the left) inside the tile (AGAIN) the next tick. And is indeed locked up.
I think it should be (again if i understand it right, i dont see the layout, so sorry if i am again wrong)
For each Sprite
______________ Set sprite to the future
___ Sub event :The tile check condition
____________Sub event : velocity > 0 <--- means it is approaching coming from the left.
___________________action: set outside tile .. = (tile index * 32) - 16 <------ on the left side
___________________action: make velocity positive
____________Sub: Else <--- means it is approaching coming from the right.
___________________action: set outside tile .. = (tile index * 32) + 16 <------ on the right side
___________________action: make velocity negative