The server alias syntax is the same as on the client side. You can place aliases inside server.cfg or choose to separate them into their own file for the sake of neatness.
server.cfg
exec aliases.cfg
aliases.cfg
alias "meleeon" "sm_cvar sm_meleemode_enabled 1;sm_cvar example 0"
alias "meleeoff" "sm_cvar sm_meleemode_enabled 0;sm_cvar example 1"
You should also be able to change the default values of cvars registered in SourceMod plugins or have them vary by map. Just ask if that interests you.
The basic answer is you'd create a config file, put it in the proper place, and then "exec" it when you want to use it.
First, you have to create the file. Any text editor will do, but if you're just using Notepad, I'd suggest upgrading to something like Notepad++.
Enter whatever commands you want to execute (in this case, the block of commands you've already come up with) and then save the file in:
...\steamapps\common\Team Fortress 2\tf\cfg
Once this is done, you can execute the config file by opening the console and typing:
exec myconfigname.cfg
This will run whatever commands are in the file.
Since you can bind commands to keyboard keys, you can extend this to "exec" commands by pressing keys, for instance:
bind "KP_5" "exec myconfigname.cfg"
would make the 5 key on your keypad execute the config file "myconfigname.cfg". Since config files can rebind keys, you can get pretty fancy with turning things on and off - bind a key in each config file that cycles through your configs, for instance.
There's a lot of power in the console (and, by extension, config files) - there's a good tutorial on the Steam forums here which I referenced in making this answer.
Best Answer
It will allow the script execution and just ignore the command.