After a lot of painful testing, I have finally managed to get SEP to install as part of an SCCM task sequence. The reason it would not install previousley was due to a pending restart from other software that had installed during the task sequence.
I tried moving the SEP installation to various stages in the task sequence and eventually found the right place to put it so that it does not cause the same error (pending restart), on other applications. It did take a while to work it out, and I have ahd to add another system restart as part of the task sequence. However, it does now seamlessly install to 7 different models of PC, all with different software (using variables) in one task sequence.
Just to let you know if anyone else has the same problem, I inatalled SEP using the first method i mentioned in the first post (self contained .exe file and created a .cmd file). Not sure if I actually need the /wait and set errorlevel command, but I dare not take them out as it works exactly as I want!
Hope this helps - and thank you to those who helped me work out the issue in the first place.