I guess what I was thinking about was that the process of redefining an already existing UCS being similar to applying constraints, because it is being defined in relation to some other geometry, whether the native origin work features, or some other existing geometry. And I was thinking that if it was defined according to the geometry of something in a component, that it should move with that component's geometry. But after a bit more testing I see that is not the case. The component can be moved after that point, and the assembly level UCS will stay where it was.
Here is one of my iLogic rules, using the same test assembly as I was showing above. Just to make things interesting, I opened the second component, and redefined the custom UCS within it, so that it was not aligned with its main origin features. Then, back in the assembly, I created this iLogic rule. It first gets the proxy of the UCS that exists within the second part. Then it pre-multiplies the matrix from that proxy by the matrix of the component it was within, to get the composite matrix that is accurate to the main assembly's coordinate system. Then it sets that composite matrix as the transformation of the new assembly level UCS that it creates. Then it creates the 3 flush constraints. This worked OK for me in my tests, without moving anything, and without any other constraints or grounded statuses involved.
Sub Main
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Exit Sub
Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Dim oOcc As ComponentOccurrence = oADef.Occurrences.ItemByName("Coordinates Part 2:2")
Dim oOccUCS As UserCoordinateSystem = oOcc.Definition.UserCoordinateSystems.Item("Part 2 UCS")
Dim oOccUCSProxy As UserCoordinateSystemProxy = Nothing
oOcc.CreateGeometryProxy(oOccUCS, oOccUCSProxy)
Dim oAsmUCSDef As UserCoordinateSystemDefinition = oADef.UserCoordinateSystems.CreateDefinition
Dim oMatrix As Inventor.Matrix = oOccUCSProxy.Transformation.Copy
oMatrix.PreMultiplyBy(oOcc.Transformation)
oAsmUCSDef.Transformation = oMatrix
Dim oAsmUCS As UserCoordinateSystem = oADef.UserCoordinateSystems.Add(oAsmUCSDef)
Dim oConstraints As AssemblyConstraints = oADef.Constraints
oConstraints.AddFlushConstraint(oOccUCSProxy.XYPlane, oAsmUCS.XYPlane, 0)
oConstraints.AddFlushConstraint(oOccUCSProxy.XZPlane, oAsmUCS.XZPlane, 0)
oConstraints.AddFlushConstraint(oOccUCSProxy.YZPlane, oAsmUCS.YZPlane, 0)
End Sub
Wesley Crihfield

(Not an Autodesk Employee)