The Pseudo breakdown would be something like this...
Make the connection to your Remote Server and create a FileList var (RmtFiles) of the files you need to test. -- Or, you could get the files and generate a FileList var --
Loop through the RmtFiles FileList var
Get the lastModifiedDate (FileInfo) of the RmtFile
Find and get the corresponding lastModifiedDate (FileInfo) of the Local File to compare
Do Comparison of the 2 Dates
Function according to value