melky
Probably a better way to do this. At minimum you press the key only twice. When you press and hold the bind it will auto join as spy, and on release it will disguise as enemy medic and switch to slot2, and then just hit the key again to show medigun on the 3d playermodel. Just tried it on a serveme and it seems to work.
bind "X" "+toggleState"
alias +toggleState "join_class spy; cl_hud_playerclass_use_playermodel 1; r_drawviewmodel 1"
alias -toggleState "disguise 5 -1; slot2; lastdisguise"
There is a weird bug with the bind where "lastdisguise" will sometimes be sent to the server before "disguise 5 - 1". idk what causes it but if you want it to be fool proof just press b for lastdisguise and just remove the command from the alias. Disguising has a big delay anyways so pressing b shouldn't be that big of a deal.