Within each key there are seven chords. If I understand it correctly the "first" six correspond to the minor and major variants of the current key and its immediate neighbors in the circle of fifths, i.e. standing on their respective tonics (e.g. for C these are C, a, F, d, G and e). But the seventh one is the diminished, and I'm not clear on what I should think of that one. At what point in a chord progression would it make sense? Could I use it in moving e.g. from C to G, e, D or b?
The diminished chord has the function of a dominant chord and wants to go back to the tonic chord (the I chord). For example in the key of C major, Bo would want to go to C.
If you're familiar with the concept of the dominant 7th chord (V7) this should make sense as the dominant 7th chord also goes to the tonic the diminished triad is contained within the dominant 7th chord. In the key of C, the dominant chord would be built of G and G7 would contain the notes:
G B D F
If you were to build just a Bo triad you would have the notes
B D F
Which you can see are all in the G7.
So pretty much anywhere you could use a G in the key of C major you could also use Bo.A simple example of a progression you could use a Bo in the key of C major is:
C F Bo C
First, lose this idea than being 'in a key' restricts the notes and chords that may be used. It merely establishes a framework of which chords are plain diatonic vanilla, which are exotically chromatic. It would be a very sad, restricted musical world if every chromatic chord made us leap into another key where it was predictably diatonic!
Back to your question. The vii chord can be usefully considered as the upper structure of a V7. It contains the two main tension notes of a dominant 7th, the leading note and the 4th degree of the scale, forming the tritone interval with its strong tendency to resolve to the root and 3rd of the tonic chord.
Extend the diminished triad into a full diminished 7th chord (and yes, although it contains the b6 of the tonic scale, it doesn't mean we've entered or even visited another key - yet!) and all sorts of interesting possibilities open up. But that's another lesson.
There's also flat ii, flat iii, flat iv, flat v, flat vi....all in the same key. It's not that there are only seven tones it's that we commonly harmonize the 7 scale tones. The cool thing about a diminished chord is that every note in the chord can be called the root note.