For a simple command line \ batch file:
netsh firewall set opmode disable
Or with PowerShell:
$firewall = New-Object -com HNetCfg.FwMgr
$firewall.LocalPolicy.CurrentProfile.FirewallEnabled = $false
Both work fine under Windows Vista. If you are still having issues then I'd dig further to ensure that you have the right permissions and that you are using core windows components to execute the script. I have a parallel install of PowerShell (used by the VMWare VI Toolkit) that throws exactly the same security exception you list above when I try to use it to disable the firewall but for the basic Powershell v1.0 installation it works fine.