Memory tag's previous and current values

I know that memory tags value or quality change scripts has access to previous and current values and also gateway event scripts as well.

I want to know if project library scripts has access to previous and current values. My script runs 24/7 and every run, it set
variable_x = tag value
at the very beginning.
At the very end of my script before it goes back to beginning, it will set
prev_variable_x = variable_x.
This is just 1 example, but in general my script looks at hundreds of tags.

Does these scripts have a way to do something like tag.getPreviousValue() and tag.getCurrentValue() or something like that?

Sounds like an infinite loop in your script. That, by itself, is very bad for event driven systems like Ignition.

A project library script's top-level variables are persistent from one function call to the next, so a top level dictionary is a good place to cache previous values.