Dynamo Crash from data formatting

Hi there!

I have built a script that essentially pulls Revit parameters, then formats that data in a specific list structure before exporting to a txt file. It works perfectly on small models, but as soon as I go over 50 elements in the model, Dynamo crashes. Unfortunately, the list structure and text formatting is incredibly specific to how our internal teams need it downstream in our processes and I need to be able to run this script on models with 2000+ elements in it. Any ideas how to condense the script or figure out how to fix this issue? Thank you. Script attached. Crash Report example below.
PD5 Export - split.dyn (956.3 KB)

Dynamo Crash

Any help is greatly GREATLY appreciated!