QuakeForge has had a "pak" utility for quite some time (early 2002: I believe I'd written one earlier, but I can't find it). It's usage is very similar to tar (main difference is the us of - before the commands), though I think it's a one-shot deal (you can't add files to an existing pak).
As a bonus, QF also has a "zpak" script that extracts the files from a pak, runs gzip over the files, then rebuilds the pak with the gzipped files. QF does fully transparent gzip decompression: it will look for (eg) start.bsp and start.bsp.gz, and irrespective of the extension, check the file for gzip compression and decompress as it reads (unless told otherwise). pak0.pak and pak1.pak use 23MB combined, and then with QF's ogg support and streamed sounds, the music takes 66MB

Before you embark on WAD2/WAD3, you might want to take a look at qf's wad tool (tools/wad). One bit of warning though, wad.c and pak.c are really just the command-line interface: the format handling code is in libs/util/wadfile.c and libs/util/pakfile.c. In general, anything "shared" between engine and tools is in libs (usually util, but some other dirs (eg, image, gamecode) are also shared).