I do not have particular idea of this but what you could possibly do is append the line below:
%sudo ALL=NOPASSWD: ALL
which would then not ask password from all the users who can sudo. Or, you could do that per user:
user_name ALL=(ALL)NOPASSWD: ALL
Just be sure to use
visudo to do so as I'm not entirely sure about the syntax.
Alternatively, you could save your script somewhere and try doing this, this is file-specific so might suit you better:
user_name ALL=(ALL) NOPASSWD: /home/username/wifi_script
Make sure you use the
sudo visudo command to edit the
/etc/sudoers because I am not 100% sure about the syntax I've just written & I'm too lazy to test them