Duplicate transactions are determined by looking at a variety of information, including (assuming you're using SIM):
The SIM API allows you to specify the window of time after a transaction is submitted during which the payment gateway checks for a duplicate transaction (based on credit card number, invoice number, amount, billing address information, transaction type, etc.) using the duplicate window field (x_duplicate_window). The value for this field can be between 0 and 28800 seconds (maximum of 8 hours).
So if any of that information changes, it probably wouldn't be counted as a duplicate. It's also supposed to pass you the original authorization code if it detects a duplicate, so it's theoretically possible it's saying the transaction is ok but giving you the status from the first run. Or you might have messed up your variable settings and it could be running permanently in test mode, which is probably not going to generate duplicates because it isn't actually processing the transaction, just doing the most basic surface checks.
Please (1) print out all data you're passing and post everything except your login ID and transaction key, (2) post the code surrounding what you pasted here, and (3) post a var dump of the entire response using print_r(). Use code boxes, fourth option from the left in Rich Text mode.