Yup if I cancelled the deal then it wouldn't return the items back. Let me try if they're the one who cancel's the deal.
EDIT: Actually your script really works fine. It's my fault. Forgot to put the script in cancel function.
EDIT2: In your script with this content "if(itemdb_cantrade(&item, 0, 0) == 0)", shouldn't it suppose to be "if(itemdb_cantrade(&item, src_lv, dst_lv) == 0)" because if it's both 0 how about if a gm with group lvl is allowed to trade the item without requiring the item. I think that the GM would also get the trade pass item even if he/she doesn't use one. Am not sure. Because that's what is happening to my server right now. I get a trade pass item without even using one.