Reusing animation at specific locations and timelines
I have made a loop that provides the on and off logic for the lightning. The float list provides the frame numbers for the on then the off then the on then the off etc..

For moving around the lightning I used an empty and  moved it about and inserted some key frames into the timeline. &quot;Vector from value&quot; node controls the amplitude of the randomnes. The &quot;vector math multiply&quot; node after the &quot;vector wiggle&quot; node makes sure the randomness only affects the x and y coordinates.

If you want to append this to another project append the bezier curve as well as the node tree and add an empty. And select them in the appropiate nodes. Chris P who did the tutorial has tutorial called &quot;#5 - Audio + Peak-Meter - Animation Nodes in Blender 2.8 - Tutorial Series&quot; for learning how to use audio files to alter the animation.
I have added a blendfile done in Blender 2.93 beta and animation nodes + extra nodes 2.2.2
Also you might want to append your shader tree to the file as it looks different to mine from the gif

For this blend I have disconnected the on off logic loop recconected the number of bolts node. Deleted thekeyframes for the empty.

I have added the sound spectrum node here to give you some ideas. You add your path to your mp3,wav,flac etc file via the sound input node. You may have to fiddle with the values like amplitude etc in the sound spectrum node depending on the dynamics of your music. Doc for Sound spectrum node


I've never used the sound spectrum node before, but I hope this gives you some ideas. I have just thought that you if you are doing visuals to repetitive music like house etc you can get the frames per a bar by mutiplying the bpm of your tune by the frames per second of the render then dividing by 60. Then divide by 4 to get frames per a beat.
Here is an answer to a question about the sound spectrum node that will help you familiarise yourself with it.
sound spectrum