Tile a texture and randomly rotate it at 90 and 180 degrees only

After testing the material node , I am not sure if rotates the uv tiles square randomly at fixed degrees. :slightly_smiling_face:

From this vid here, I am trying to randomly rotate each tile square limited to 90 degrees or 180 degrees.

From the timestamp om the vid here: https://youtu.be/VTw-IL2SgRQ?t=17

Its something along those lines. I have a texture I have painted in Krita such that I can rotate it 90 degrees in any direction, the edges match so I am trying to tile it and, all the individual squares in the tiled texture randomly rotate in different directions maintaining a 90 degree state.
Also 180 degrees as well.

I am not sure if I am explaining it well.

EDIT: Found this thread here: Random Tile Placement and Rotation in Cycles Material - #6 by anopheles
This is from one of the blend files posted there:

sample

How do I get each square rotation to always stop at a 90 or 180 degrees and the rotation placement is random?

Will really appreciate any help I can get. Thanks.