Shouldn't be too hard, but it's still beyond what I can do.
Checking ammo level is easy- AmmoHUD does that.
All you have to do is make it so that when you're out, when you switch to that weapon it autoswitches to the next one (which would require it to recognise whether you used nextweapon or prevweapon as your last command, which is the bit I can't do).
You could even add a line that when you're out for all weapons, rather than flicking through all your weapons endlessly, it switches to fallback for you.