The use of the “half -whole” diminished scale over a dominant 7th chord can create some interesting and complex sounds. This “octatonic” scale outlines specific tensions – b9, #9, #11 and natural 13. There are a lot of possibilities for different triads and shapes that create unique melodies, stimulating melodies.
This simple phrase outlines 3 major triads in root position with and added b9, each ascending by minor thirds over one dominant 7th chord. The melody could also be analyzed over the one root as #9, 3, 5, b7 – #11, 5, b7, b9 – 13, b7, b9, 5 (each of these 3 shapes are symmetrical).
The major 7 melody that fallows the diminished passage is an Major 9 arpeggio in root position.
To expand on this idea, try using shape variation of the major triad with an added b9 and group them in minor 3rd or tri-tones ascending and/or descending over the dominant 7th chord. There are many possibilities just by modulating these 4 note groupings.