prevent networksetup from asking for password
Open Terminal and enter sudo visudo to modify the file /etc/sudoers.

Change the part:

## User privilege specification
##
root ALL=(ALL) ALL
%admin  ALL=(ALL) ALL


to

## User privilege specification
##
root ALL=(ALL) ALL
%admin  ALL=(ALL) ALL
your_username ALL=(ALL) NOPASSWD: /usr/sbin/networksetup


and save the file.

If you don't know vi: after entering sudo visudo you have to change to insert mode by hitting i. Enter the additional line as indicated above. To leave insert mode hit esc. Then enter :wq and the Enter key to write the modified file to disk and quit vi.

Using sudo networksetup ... shouldn't require a password anymore.