I found a solution. It consists of two steps:
1. Store the grouping column contents in a list. Get the size of the list
2. Add a for loop in the plotting script which customs the line style if a certain criteria is fulfilled.
Here's the code for step1:
Summarize(A = by(groupcol));
B=groupcol<<get property(value ordering);
If (Isempty(B),
GroupList=A;,
GroupList=B;
);
GroupListN=Nitems(GroupList);
Here's the code for step2:
For( c=1, c<=GroupListN, c++,
If (Left(GroupList[c],1)=="S",
plotscript=plotscript||"biv << (Curve[" ||Char(c)||"] << Line Style( Dashed ));";
);
);
plotscript = plotscript|| "rbiv = biv<<report;"
plotscript = Eval( Parse( plotscript ) );
The plotscript variable contains the plotting script. The second code block is added.