Watch the Gettin' Jazzy online guitar lesson by Brad Carlton from Chord Studies: Evolving Blues Vol. 1
Measure 4 hips us to an "Altered" chord. In this case an A7#9#5. This chord resolves to the D9 in measure 5 (A is the V of D so it wants to move there naturally). We also have a very jazzy sounding turnaround, a I, vi, ii, V progression. Once again we end on the V that wants to move to the I so it is a smooth change.