This may not be strictly correct but a REALLY simple idea I had yesterday was that if you are going for a minor shift, you move either half-step (or one and a half step) up or down from your current position. For major shift try a whole step. Obviously the direction you go is going to be dictated more by what key you are playing in but this is generally how my mind works when I am trying to work out new melodies.. Also.. this is a VERY rough idea.. so may not actually hold out under scrutiny.