I really like the way Stevie Ray Vaughan spices up blues stuff using extra notes and this is a great example. It's based around an E Minor Pentatonic and throws in a little more spice using the 9th and then a trill with the b9 which is a very unusual note to use in a blues.
It can be used as I did in the demo with just jammin it on the E, or it can follow the chords as I show quickly at the end of the vid. SRV mostly used this lick over the V chord but you really can use it however you like if it sounds good!
Gear was just Strat into Zen Drive pedal and into Fender Princeston II amp. The jam used a Boomerang III looper pedal.