How come when I render my animation, the audio is clipped when I stitch together the pieces?
It is good practice to not render out movie strips to a single move file. Instead you should render images as .PNG files and add the images together in the video sequence editor. Then add the original audio clip afterwards, in the final edit. I wouldn't recommend using a script at all.

Change output to PNG:



Set range to 100 frames(to test with):



Then press the normal animation-render button:



When that's done, you go to video editing and press "Add" -> "Image" and select all 100 images.



Blender will then treat this as a movie strip.

Then you add the audio clip, and adjust so the timing matches