I think its more important to know the NOTES you're playing relative to the key signature etc. Knowing the theory and formula behind each and every scale and mode is of cos a good way to build the foundation.
However, I think what's most important is realising why certain modes give certain moods..its the notes that are important, not memorising the modes. The pain for guitarists is the fact that we need to memorise shapes and patterns and because of that, sometimes we are caught up with the shapes and we neglect the actual notes we are playing. I can never develop the fast 'eyes' on my fingers to know exactly what notes I'm hitting when I'm on the fly so I guess thats where the shapes n patterns come into the picture.
Apart from that, its also important to know what your bassist or other musicians are playing during a song/jam etc..you don't have to stick to the same modes and scales just because they fit into the key signature..you can actually for example form a chordal harmony if you can hear what your bassist is playing..doesn't have to be the same roots..
Once I had the pleasure of listening to two acclaimed yamaha teachers jam impromptu..just bass n guitar..they were actually LISTENING to each other's notes and complemented each other in the most unusual yet musical way..and anticipating which notes they were playing next..totally cool...