tf2mate can be very unorganised and has a lot of commands in its weapon switching scripts that are not needed so I suggest trying to simplify it
This is an example of my scout cfg.
I use "i" as my button to switch viewmodels on and off by switching between the aliases view0 and view1.
I always have them enabled for melee weapons.
This method is the simplest I've come across but maybe other methods make more sense to you.
It's easy to customise for each different class cfg. just change the 1s to 0s and the 0s to 1s where needed.
Hopefully this can help :)
//SCOUT.CFG
// SPAWN WITH
slot1
r_drawviewmodel 0
// BINDS
alias weapon1 weapon1_0
alias weapon2 weapon2_0
alias weapon3 weapon3_1
bind mwheelup weapon1
bind mwheeldown weapon2
bind e weapon3
bind i view1
// ALIASES
alias weapon1_0 "slot1;r_drawviewmodel 0"
alias weapon1_1 "slot1;r_drawviewmodel 1"
alias weapon2_0 "slot2;r_drawviewmodel 0"
alias weapon2_1 "slot2;r_drawviewmodel 1"
alias weapon3_1 "slot3;r_drawviewmodel 1"
alias view1 "alias weapon1 weapon1_1;alias weapon2 weapon2_1;bind i view0"
alias view0 "alias weapon1 weapon1_0;alias weapon2 weapon2_0;bind i view1"