Instance variable is the easiest way to do it. You can also try something like this:
build a string with UIDs of all picked instances in the first function and pass it as a parameter to the second function.
Make sure to separate UIDs with some character, say "#".
In your second function pick the same set of instances using find(function.param(0), "#"& str(Sprite.UID) &"#" )>-1