The Standard Riff in the 4th Blues Position (previous example) has the tonic on the 3rd string.
When you play this on the I chord, the tonic A can be found on the 14th fret.
Using it on the IV and V chord, we find their tonics on the 7th and 9th fret of the third string.
Again: we’re back in blues position 1.
As you can see: this lick does not end on the tonic.
Instead we’re ending it on the b7 of the chord, which is also often used in swing.
You can do this with any S.R. on any chord!
Try to move around as little as possible; start the lick with your ring finger on the tonic and keep every finger in one fret position.
Use your ring finger for the hammer-on from b3 to the #3 on the chord.