Always remember to be on the lookout for non-chord tones!
The measure with
G E♭ C F♯ is, in my view, a vii°7 above a G pedal. This measure is bookended by tonic chords, so the vii°7 serves its typical function of expanding tonic. And the chordal third (
A) appears at the end of the measure to fill out the chord:
F♯ A C E♭.
Your second example of
G B♭ C# E is a bit trickier, but I think it's mainly the result of voice leading. Notice that the tenor line (the higher voice in the bass clef) is just a descending line from the start of the bottom system: E♭–D–C–B–B♭–A–G. Also notice that your soprano line is mostly an ascent that starts one measure later than the bass's descent: B–(E)–D–E–F#–G. So in my opinion the
G B♭ C# E chord is really just what happens when you:
- Have a G pedal in the bass.
- Have a descending tenor line that happens to hit B♭.
- Have an ascending soprano line that happens to hit E.
With those three pitches, a fully diminished seventh is really the only possibility. You could understand it as a type of vii°7/V; C# is spelled as the root, so the chord is in 4/3 inversion. The only oddity here is that it doesn't technically resolve to a V chord; beat 3 of that measure doesn't have a D! But the D is pretty strongly implied, so this seems one valid analysis.
Another possibility is to view that downbeat as what we call a common-tone diminished seventh. These chords are just fully diminished seventh chords that share a common tone with the surrounding chords. Here, that common tone is G!