Hello,
I've wanted to make a "better" respawn bind for a long time, I've finally taken the time to make one.
It makes use of class switching rather than loadout switching (except for Medic), it's quite similar to a loadout switch bind.
You hold your respawn key, it switches you to a random class, you release the key, it switches you back to the previous class. If you mis-time it, you can just click again and switch back to the previous class. It probably works if you spam the key as well, but I wouldn't.
It should work regardless of other scripts, it makes use of "native" features only and does not require you to overlay all your class change binds.
It may not work in situations where all class limits are filled up (e.g.: highlander lobbies).
https://github.com/ldesgoui/tf2-custom/tree/master/optimal-respawn-bind
It may not work for everyone, but it works for me, and I'd rather share it than keep it to myself.
Hopefully you can make good use of it.