The "frame" in my example is your addon's options frame, or even a specific colored box within your options.
Lua Code:
local myframe=CreateFrame("frame")
-- frame sizing, parenting, texture, color, etc
myframe:SetScript("OnMouseUp",function(self,button)
-- the cursor info and clear here
-- button == "LeftButton" or "RightButton"
end)
The code will do nothing if the user doesn't release the item over this specific frame. No need to check for any other location.