Phrakturebind "MWHEELUP" "slot1; sensitivity 4.2"
bind "MWHEELDOWN" "slot2; sensitivity 2.5"
bind "q" "slot3; sensitivity 2.5"
put that in your soldier class cfg. change the binded keys to whatever you use
to reset you can put this in your other class configs
bind mwheelup slot1
bind mwheeldown slot2
bind q slot3
sensitivity x
Note on quote marks, you don't need them unless you are stringing commands together in a place where only one command would normally go, or if a command includes spaces and you need to keep them together. So because keys don't have any spaces, you don't have to put quotes around them. However, the "slot1; sensitivity 4.2" is correct because otherwise the sens setting won't be part of the bind and will be executed along with the config.
Personally I would do this via aliases, like so
In autoexec
bind 1 primary
bind 2 secondary
bind 3 melee
soldier.cfg
alias primary "slot1; sensitivity 4.2"
alias secondary "slot2; sensitivity 2.5"
alias melee "slot3; sensitivity 2.5"
other class.cfg files
alias primary slot1
alias secondary slot2
alias melee slot3
sensitivity x