You may find it conceptually easier to code using data filters on each table to select the rows which do not meet your limits. You can then save the script to the script window.
You can then use << get selected rows(); If you use << Select columns (); as the command before it will only pull out a subset of the values for the selected columns.
This data could then be compiled before writing to a new data table.
As you loop over the data tables you can use the <<Close Window(); command to close each filter after you are finished with it if the data tables have different column names.