Try this. It uses the
General Program Mode, which is a bit more flexible:
Code:
program:
# Candidate template for non-fanfiction books
reg_title = strcat(
field('title'),
finish_formatting(
field('series_index'),
'0>2s',
' -',
'- '
)
);
# Candidate template for fanfiction books
fanfic_title = strcat(
field('title'),
' (',
field('#chapters'),
'ch, ',
field('#words'),
') ',
field('#status'),
' ',
format_date(
field('#updated'),
'M-d-yy'
)
);
final_title = strcmp(
field('series'),
'Fanfiction',
reg_title,
fanfic_title,
reg_title
);
Basically, calculate the two templates, and check the value of series to see if it matches (case-insensitive) "fanfction". Then return whichever template is appropriate.
The last function is the return function, so final_title is the return value of the template.
This looks a little bigger than it really is

because I prefer whitespace for readability.