include your file inside a hook that is called after ULX loads.
function LoadMyCustomScript()
include( myscript.lua )
end
hook.Add( ulx.HOOK_ULXDONELOADING, "LoadMyCustomScript", LoadMyCustomScript )
Then just save your script as myscript.lua (or whatever just change above) and place it in garrysmod/lua (not autorun).
The code above SHOULD be in something that gets autorun. Preferably as a ULX module so it gets called after ulx is created in memory for the hook name.