Sorry i've deleted my last 2 posts, and i apologize for thinking it's your script, I don't think it is now.
It seems that it's happening without your script when ive tested further.
It was probably just the fact I didn't notice the issue until i used your lighting script and instantly assumed it was your script causing it, so apologies for that.
I think it's a problem with a parallel process I have running to display a quest marker over the head of the NPC.
When I pick the quest up when the FPS has dropped the fps returns back to normal and there's no issue after.
Viewing post in [CGMZ][Beta] Light Effects for RPG Maker MZ comments
You could maybe use [CGMZ] Event Names to accomplish showing a quest marker above an NPC, though you would need to use separate event pages to get it to display / not display. It supports icons and can even have a float effect applied to it.