Using a journal is key.
In the most general non-linear case, it might be possible for the player to find the item before the quest is given, so the quest giver needs three conditionals, based on the quest state:
1. Please find the macguffin (journal = 0, set to 1)
2. Have you found the macguffin? (journal = 1)
3. We have no further business (journal = 2, or unconditional).
Both case 1 and case 2 should allow the PC to reply "here is the macguffin" when GetIsItemPossessedByParty is true.
To prevent an exploit, the NPC line following "here is the macguffin" should repeat the check, then, if still true, remove the item (identified by the same function call) and set the journal to 2. This should be followed by an unconditional NPC line "but you don't have the macguffin!"
This is to prevent an exploit whereby the PC has the item, therefore get the option to hand it in, but, before clicking that option, drops the macguffin on the ground. In this example, the PC can't obtain duplicate rewards, because journal is now 2, but it's good to be consistent. Occasionally, the macguffin might be useful or valuable, so you don't want the PC to keep it by cheating. In other cases, such as payment, you might not have a journal entry, but you want to be sure that the PC still has the money when the transaction is completed.