How about `bibsort`?
NAME
bibsort - sort a BibTeX bibliography file
SYNOPSIS
bibsort [optional sort(1) switches] < infile >outfile
DESCRIPTION
bibsort filters a BibTeX bibliography, or bibliography frag-
ment, on its standard input, printing on standard output a
sorted bibliography.
It's a shell script wrapping `nawk` (and `tr`, `sort` and `grep`) and includes two warnings you might have to pay attention to (see the source).
( **Edit** There're also a lot of bibtex-related Perl modules...)
**Edit2** I just recognized you'd like to sort for _any_ key, while `bibsort` apparently sorts by _the bibtex tags_ only -- but maybe its source (it's not too long) is still helpful...?