In order to make the UserAgent “stick” between launches in Safari, one has to edit the plist which is at ~/library/preferences/com.apple.safari.plist .
Find CustomUserAgent, and edit the value string.
(Find the string by hovering above the menu item in the develop/user agent menu.)
To return to plain old Safari, just delete the value string (so that it’s blank) and save the file again.