The script like in wpad.dat stays the same, but you deploy is as an "Automatic Configuration Script".
The script file extension should be PAC file (not DAT like for the wpad server).
Maybe you can work with a logon script and a logoff script.
Maybe this can help:
http://www.adminscripteditor.com/scriptlibrary/view.asp?id=377