I have my install of Steam on a second hard drive (D). Whenever I format my main drive (C)and reinstall my PC all I do is reinstall steam (using the 700k steaminstaller.exe) in the same directory as before on the D drive. and it saves everything (cfg files, screenshots, demos, etc).
I've also copied my Steam folder from one PC to another, ran the steaminstaller to install steam back into the new folder on the new pc and had it working within minutes.
I've heard you can copy the folder which contains your personal game data too (the one in the steamapps folder named the same as your username) and just put it back in the same place once you've reinstalled steam. You'd have to wait for steam to update before you could play though.