Welcome to the forum! I've done it a lot on RSLogix 5000 PLC's, but not on an old ML1500. Although the concept would be the same.
Set yourself up an array, then each time a sample is taken do the following:
1. Check for good/bad. If good, do nothing; if bad, add 1 to a counter or integer
2. Check if the FIFO is full (.DN bit set). If not, skip step 3 and go straight to step 4
3. Unload the FIFO and check the unloaded value. If it represents a good sample do nothing; if it represents a bad sample subtract one from your counter/integer (as this bad sample is now no longer within the last 100 samples and shouldn't be counted any more)
4. Load the FIFO with your latest sample result
5. Do a simple calculation comparing your counter/integer value with the total number of samples that you're comparing (i.e. 100 or 1000) to work out the percentage good/bad
6. Attach electric cattle prod to sampling operator and trigger if sampling success rate drops below 75%
7. Profit!
(steps 6 and 7 optional. Especially step 7)
Hope that gets you started!