Your specific error is you are doing a foreach command against a string variable (Row.XYZ), where each iterated item returned is a char type and so you when you try to re-cast it as a String in the loop initializer you get the error you see.
Your more general problem is that your script task already is part of a loop. In your original code, you read in a List of Strings and so had to loop through them, but in SSIS, the loop is the data flow itself, and so each row is already passed into Input0_ProcessInputRow individually and so you don't need to do a foreach (Row.XYZ). Instead just do this:
var reg = new Regex(@"\w+", RegexOptions.IgnoreCase);
var titles = new Regex(@"[JS]r|II?I?");
var names = reg.Matches(Row.XYZ)
.OfType<Match>()
.Select(m => m.Value)
.ToList();
names.Reverse();
List<string> output = new List<string>();
foreach (String name in names)
{
Match title = titles.Match(name);
if (title.Success)
{
output.Insert(0, name);
}
else
{
output.Add(name);
}
}
output.Reverse();
Row.YUX = string.Join(", ", output.ToArray()) + ".");