iLogic is always the best tool for automating Inventor and in many cases, even when it is you'll still be able to prototype code easier and faster in VBA or Visual Studio. What you're trying to do is a case where I don't think iLogic is the best choice. Here's a version of the same thing in VBA. This will also process a directory of part files, but this version won't handle sub-directories. I also added a check to handle if the file already has the parameters. The previous version still worked but you would end up with multiple parameters with numbers appended to the names to make them unique.
Public Sub AddProperties()
Dim pathToProcess As String
pathToProcess = "C:\Temp\Files\"
Dim fileName As String
fileName = Dir(pathToProcess & "*.ipt", vbNormal)
Do While fileName <> ""
ThisApplication.StatusBarText = "Processing file: " & fileName & "..."
Dim doc As PartDocument
Set doc = ThisApplication.Documents.Open(pathToProcess & fileName, False)
' Add the parameters, if they don't already exist.
Dim userParams As UserParameters
Set userParams = doc.ComponentDefinition.Parameters.UserParameters
' Check for the existence of the parameter "Costlb" and exit the program
' if it does exist. It's assuming they all exist if "Costlb" is there.
Dim param As UserParameter
On Error Resume Next
Set param = userParams.Item("Costlb")
If Err.Number = 0 Then
MsgBox "The parameters already exist. Exiting the program."
Return
End If
On Error GoTo 0
Set param = userParams.AddByValue("Costlb", 0, "ul")
Dim values() As String
ReDim values(2) As String
values(0) = "0.65 ul"
values(1) = "1.65 ul"
values(2) = "2.05 ul"
Dim expList As ExpressionList
Set expList = param.ExpressionList
Call expList.SetExpressionList(values, True, 0)
Set param = userParams.AddByValue("Material", "", "Text")
ReDim values(3)
values(0) = """Steel"""
values(1) = """Bubble Gum"""
values(2) = """Potato Salad"""
values(3) = """Titanium"""
Set expList = param.ExpressionList
Call expList.SetExpressionList(values, True, 0)
Set param = userParams.AddByValue("By", "FJNII", "Text")
Set param = userParams.AddByValue("Company", "Company Name", "Text")
Call doc.Save
Call doc.Close
fileName = Dir()
Loop
ThisApplication.StatusBarText = "Finished."
End Sub