I wrote this post in response to a question on the Steam forums and thought I might offer it to you guys also.

You'll need to add this to your autoexec.cfg, so that every class with an autoreloadable weapon can take advantage of the script.

Code:
//Auto-Reload Script
alias "+zreload" 			"-reload; +attack"
alias "-zreload" 			"-attack; +reload"
*Note* If you don't have an autoexec, just copy any class config from your Steam\steamapps\USERACCOUNT\team fortress 2\tf\cfg folder, delete the contents, then rename it to "autoexec" without quotes, and insert the above reload script.

It's important that you go through and rebind your weapon keys in each class cfg so that you don't encounter the odd weapon behavior that can carry over after changing classes, because each class config is executed everytime you switch to the respective class. Rather than just forcing people to figure out how to do this correctly, I'll paste my class cfg contents so that you can fully understand what I mean and then tailor the scripts to your needs, keybinds, and preferences.

These are my preferred weapon binds, change these as you copy them to suit your preference:
c = primary weapon
v = secondary weapon
x = melee weapon

Demoman.cfg
Code:
//Grenade Launcher Auto-reloads
//Sticky Bomb Launcher Does Not Auto-reload
bind c "slot1; +reload; bind mouse1 +zreload"
bind v "-reload; -attack; slot2; bind mouse1 +attack"
Engineer.cfg
Code:
//Shotgun Auto-reloads
//Pistol Rapidfire and Auto-reloads
bind c "slot1; +reload; bind mouse1 +zreload; -QF"
bind v "slot2; -reload; bind mouse1 +attack; ZZZ"

//Pistol Rapidfire and Auto-reloads
alias ZZZ "bind mouse1 +QF"
alias +QF "alias RF F; F"
alias F "+attack; wait 3; -attack; wait 3; RF"
alias -QF "alias RF ; wait 5; +reload; wait 3; -reload"
Heavyweapons.cfg
Code:
//Prevents Minigun From Autospin
//Shotgun Auto-reloads
bind mouse1 "+attack"
bind c "slot1; bind mouse1 +attack; -reload; -attack"
bind v "slot2; +reload; bind mouse1 +zreload"
Medic.cfg
Code:
//Default Weapon Behaviors
bind c "slot1; bind mouse1 +attack; -reload; -attack"
bind v "slot2; bind mouse1 +attack; -reload; -attack"
bind mouse1 "+attack"
Pyro.cfg
Code:
//Removes Flamethrower Sputter
//Shotgun Auto-reloads
bind c "slot1; bind mouse1 +attack; -reload; -attack"
bind v "slot2; +reload; bind mouse1 +zreload"
bind mouse1 "+attack"
Scout.cfg
Code:
//Scattergun Auto-reloads
//Pistol Rapidfires and Auto-reloads
bind c "slot1; +reload; bind mouse1 +zreload; -QF"
bind v "slot2; -reload; bind mouse1 +attack; ZZZ"

//Pistol Rapidfire and Reload
alias ZZZ "bind mouse1 +QF"
alias +QF "alias RF F; F"
alias F "+attack; wait 3; -attack; wait 3; RF"
alias -QF "alias RF wait; +reload; wait 3; -reload"
Sniper.cfg
Code:
//Default Weapon Behaviors
bind mouse1 "+attack"
bind c "slot1; bind mouse1 +attack; -reload; -attack"
bind v "slot2; bind mouse1 +attack; -reload; -attack"
Soldier.cfg
Code:
//Rocket Launcher and Shotgun Auto-reload
bind mouse1 +zreload
bind c "slot1; +reload; bind mouse1 +zreload"
bind v "slot2; +reload; bind mouse1 +zreload"
Spy.cfg
Code:
//Default Weapon Behaviors
bind c "slot1; bind mouse1 +attack; -reload; -attack"
bind v "slot2; bind mouse1 +attack; -reload; -attack"
bind mouse1 +attack
I realize that in a number of these aliases/binds a few commands are redundant; however this circumvents a few annoying behaviors that previously cropped up from time to time.

Please be sure to fully understand what these commands do before you change or copy/paste them to your configs.