Extract differences between two lists

I’m writing a script that will get all the filenames of a certain folder, set that as a variable, wait a few seconds, do the same and set it as a another variable.

How can I compare the two variables of lists extract the differences?
Essentially this:
var1 is {“a”,“b”}
var2 is {“a”,“b”,“c”}
then return a result of {“c”}

A simple way to identify any new items would be to loop through the second list:

set var1 to {"a", "b"}
set var2 to {"a", "b", "c"}
set l to {}
repeat with v in var2
	if v is not in var1 then set l's end to v's contents
end repeat
l
--> {"c"}

To identify all differences, iterate through both lists:

set var1 to {"a", "b", "d"}
set var2 to {"a", "b", "c"}
set l to {}
repeat with v in var1
	if v is not in var2 then set l's end to v's contents
end repeat
repeat with v in var2
	if v is not in var1 then set l's end to v's contents
end repeat
l
--> {"d", "c"}

If you want to know which items have disappeared and which have been added, then use two result lists:

set var1 to {"a", "b", "d"}
set var2 to {"a", "b", "c"}
set l1 to {}
set l2 to {}
repeat with v in var1
	if v is not in var2 then set l1's end to v's contents
end repeat
repeat with v in var2
	if v is not in var1 then set l2's end to v's contents
end repeat
{l1, l2}
--> {{"d"}, {"c"}}

Wow, thanks for the thorough reply. Definitely solved the problem!