Sorry, for not replying sooner. SERP (in case of Google) is determined by relevant content based on key phrase searches. Scripts, if you are referring to loading speed, has little to do with SERP, but one nonetheless.
Google, like all web crawlers, use a lynx type browser for simplicity sake, to view page content. If the content is readable, then it will be indexed. If the content is contained in a script and not output to the browser as readable text, whether hidden or shown, then it cannot be indexed.
JS menu's are a big no-no as an example, if the link parameters are contained with the JS itself vs. JS enhanced where the menu content is contained in a readable tag, ie. ul or div.
Basically.... as long as its in the source, it can then be read. Some aspects are discarded from source text, ie. comments.
Scripting by itself has no impact on SERP's, it is primarily content + links that impact SERP positions.
It's not so much a script change, but it's Google having to re-index content. Additionally, the position of content, div-wise can affect SERPs. Try comparing the position of content, and the amount of UI crap, that the bot doesn't care about, before and after the script change.
If in script you are referring as software majdi, then a complete software change is absolutely going to see an immediate drop in results due to the way the content is displayed, rendered, navigation, etc etc...
Any major software change or upgrade, even style change if it relocates specific content, can change your search results, thus traffic, in a positive or negative manner.
Googles main algorithm is based on semantic connectivity, which means even the introduction of a sentence or change of existing word / phrase locations can and will make an impact on SERP placement.
thank you Anthony, very informative answer which pushes me to ask more question in quest for knowledge
does SERP always drops immediately after a software script change or can it raise?
what about on the long term?
It can go either way, depending on whether the algorithm favours the results or not. Its very usual to see an immediate decline, could only be 24 - 48 hrs, then increase, whilst the algorithm calculates whether to favour or negate the change based on its computation.
Long term results are difficult to measure, as they are always a guess. Testing and adjusting is everything with rankings. Testing usually must be done over 3 month periods to get an accurate assessment, some changes you only need a week or two to see improvement or decline. From a community where content is growing daily, then you should see a steady increase in traffic annually. For a static site, ie. business, things are much different and you really need to either make the site interactive with blogging, support, etc, or build advertising across the niche market.