There is little question that the most difficult type of balance challenge guitarists face is that of playing a clearly melodic line in a homophonic texture (one of chorale-like block chords).
So common is this technique needed that we've developed an entirely unrelated but nearly universal way of playing to cover our inability to do it well: chord rolling. As the melodic note is normally in the uppermost voice, rolling the chord enables even inexperienced hands to produce the effect of the highest-note-is-loudest. Rolling facilitates it by allowing us to play each note individually, making an extra emphasis on the last note, with the a finger, reasonably easy.
Unfortunately, rolling chords often sounds bad. It sounds rhythmically sloppy, stylistically inappropriate and when done a lot as it often is, resembles a tic, a habit, not an interpretive idea. In the Baroque era, rolling or otherwise arpeggiating a chord was common, but it was regarded as an ornament. We don't trill every note, but it's amazing how common it is to hear every chord rolled.
I like to compare the effect to the sound of the cliche lounge pianist. It may be a familiar effect there, with smoke in the air and a drink in your hand, but it doesn't sound like Mozart. It's a deliberately "sloppy" way to play for the lounge pianist, done for the atmosphere it creates, but what about for us? Generally speaking, we aren't playing in a lounge.
Which brings us back to balance. In this post I'll describe how I train the right hand to produce clear balance in a block-chord texture.
The first challange is to train the a finger in a four-note chord. Since a does most of the heavy lifting in this arena, it serves our purposes well to focus on it. Play a simple 4-note chord, say, C major, 1st position (c-g-c-e). Plant the thumb and fingers on their respective strings lightly. Now press down with your a finger; depress the string towards the face of the instrument. Do so without moving the other three strings. This takes some getting used to. Without playing the notes, practice pressing in with only a, and carefully watch that the remaining strings are not affected. Now, do so again and with a pressing down, release all the strings. The goal is a sharply loud a finger with a barely audible supporting chord. Keep trying this, making subtle adjustments in angle and pressure until you can produce the desired effect. It is ok to permit the a finger to "follow-through" in a more visible way than the other fingers. The melody note is being played by a finger that both presses harder on the string and follows through more after the stroke than the other fingers.
I find the following thought excercise helps: I imagine that it is literally only the a finger playing, but that the VIGOR of its stroke causes the remaining fingers to be moved off their prepared position on the other strings, creating a shadow of a sound. The non-melodic fingers need only graze the surface of the string, to hardly set it in motion at all, and it will be enough. Therefore, the jarring motion created by the melodic finger is enough.
As you can see, I am establishing a sharp difference in volume between foreground and background in the excercise and, indeed, in playing generally. I find that most textures that require this device benefit from a more sharply drawn distinction of this type than is generally heard on the guitar. In other words, it's hard to overdo it. Bringing the level of the melody note down or the accompanying notes up is easy, once the extremes are well established.
Once the effect is taking hold, change chords, creating short melodic gestures. Work to maintain this balance throughout.
Another way I like to get the hand to produce this effect is to play, in quick succession, the accompanying notes then the melody note: soft then loud. Switch the sequence, loud then soft. Then put the notes together, maintaining the same respective levels. Alternating like this can help quite a bit.
Remember, the most important organ you have for getting this right is your ears. Listen closely, and hold yourself to an impossibly high standard.
Do the excercise with each of the fingers. After some work, you should be able to play a steady, repeating block chord, but with each repetition, a different note will be emphasized, and the remaining notes played quietly, such that it will sound like a linear arpeggio instead of repeated block chords. (While repeating a four note chord with p-i-m-a, first play p loud, then i loud, then m loud, then a loud, in succession, and so on.)
Train your right hand to pull melody notes out of complex textures and present them without ambiguity for your audiences. Picture the music as a singer and a pianist. Would the piano cover up the singer, making the tune obscure? Treat your scores to the same clarity of texture and respect for the foreground material. Your hands will get better, and your music will sound beautiful.