• Ensure you do what you do in the same job step, no telling what may happen if it moves step and gets a different spid while its in single user mode not allowing you to access the DB as someone else beat you to it.

    So

    ALTER DATABASE myDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE

    GO

    RESTORE DATABASE myDB FROM DISK = 'xxxxxxxxxxxxxxxxxxxxxx'

    GO

    In the same job step.