This AHK script provides functions that you can call from your own scripts to switch any one of the 4 loadouts. Only fullscreen resolutions 1024x768 and higher are supported. Anything lower than that and the script can't read the extremely scaled loadout UI. I don't have the 5th loadout unlocked so I can't search yet for 5th loadout icon in the script.
If you don't have AHK downloaded and installed it can be found at http://www.autohotkey.com
Take a look at the Example.ahk script to see how to switch loadouts 1-4