90 Degree Phase Shift / Rotation Algorithm for SDR
I believe this algorithm isn’t a rotation (phase shift) by 90degrees but instead is a frequency shift of fsamp/4. 
In this algorithm each sample is rotated 90 degrees with respect to the last one causing a frequency shift:

Samp1: no rotation
Samp2: 90 degree rotation
Samp3: 180 degree rotation
Samp4: 270 degree rotation
Samp5: 360 -&gt; 0 degree rotation
Samp6: 90 degree rotation
.
.
.


For a pure 90 degree phase shift all you need to do is: 

Ir = -Qi, 
Qr = Ii 


at every sample.

It might be helpful for you to read up on cordic rotation. Although you might not be interested in the cordic algorithm it will provide a good overview of rotations and frequency shifts.