I've put together an example to show how to call the ps2000_set_sig_gen_arbitrary function - one of the things that I noticed about your file was that you are calling the function inside a while loop which isn't recommended.
I've also had to change the 20e-9 term in the formula to 10e-9 in order to set the frequency correctly. Please note that in this version the sweep functionality does not work as it will require a start and stop delta phase that are different.
I created some arbitrary waveforms using PicoScope and ran them through the example sending the AWG wave to another PicoScope device. One AWG file is attached as an example.
Hope this helps.