Yes, override Transaction.Type.isDuplicate() to check for such duplicate transactions, trying to cancel the same order, similar to the way it is already done for alias assignment transactions.
Let's decide what a criterion to use for choosing a duplicate. We remove:
1. A transaction with
lower fee2. A transaction with
earlier timestamp3. A transaction that is
received later