Continue to practice your scales and modes, at as many neck positions (at least 3) as possible until they are part of your "vocabulary". You should be able to read the notes, know the chords to which they apply, and "hear" where they are in the scale(s) without having to think.
And if you think you know your scales, look into all of the scales you never heard of, why they work and how they work in chord progressions and changes. Look into tri-tone substitutions. There are some great exercises on this GT thread (see Pacman's practice exercise thread, for example), and on other sites such as Pick's Place
http://www.lucaspickford.com. Click on Lessons for some scales that I bet you don't know by heart.
It all amounts to a lot of work embedding this stuff into your subconscious so that it is at your fingertips when called upon!
