attached is a slightly better picture.
Essentially the question is whether or not the scripting component can read string inputs as portions of the script. Can the contents of a string variable be transformed into a part of the script itself?
There is no way I could think of where you can do that, but if I understood your question right, you want your code to dynamically cast input and add the right object with some attribute.
If this is true, then the following code can get you started. You obviously can add your attributes to the object as well:
Private Sub RunScript(ByVal x As OnGeometry)
If( x.ObjectType() = RMA.OpenNURBS.IOn.object_type.curve_object ) Then
' Debug string
Print("Object is a curve")
' Cast object to brep type
Dim crv As OnCurve = OnCurve.Cast(x)
'Dim new_crv As OnCurve = input_crv.DuplicateCurve()
' Since a copy of the object is passed to the VB component, you can add it
' without creating a duplicate instance
doc.AddCurveObject(crv)
Else If ( x.ObjectType() = RMA.OpenNURBS.IOn.object_type.brep_object) Then
' Debug string
Print("Object is a brep")
' Cast object to brep type
Dim brep As OnBrep = OnBrep.Cast(x)
' Since a copy of the object is passed to the VB component, you can add it
' without creating a duplicate instance
doc.AddBrepObject(brep)