Sorry for the triple post at this point, but I ended up moving to Python because it just made way more sense to me. It's a little bit slower to run, but I'm only occasionally saving books out to disk.
Code:
python:
def evaluate(book, context):
if book.series is None:
author_str = ""
for author in range(len(book.authors)):
author_str += book.authors[author]
book_str = book.title + ' - ' + author_str + '/' + book.title + ' - ' + author_str
else:
book_str = book.series + '/' + book.series + ' - ' + f"{int(book.series_index):02}" + ' - ' + book.title
return book_str