This plugin shows how you can use a GUI to obtain a list of files that you can later use for processing/calculations.
It is also a nice example of the communication between UI, script and plugin.
Please download the code here to have a look for yourself.
You can also try the compiled Win32 version.