The agent, if acting in a dual agency, committed malpractice. Rule #1 of real estate is that all contracts must be in writing. By telling you to go off to dinner and then negotiating with the other buyer, the agent breached his/her fiduciary duty to you, and you would be entitled to damages
, based upon any lost profits in the transaction -- at least the difference between the offer you made and the one which was accepted. You may also have punitive damages, to discourage future bad conduct by the agent.
In some cases, you may even be entitled to specific performance against the seller, i.e., an order forcing the sale to be made to you, rather than the other buyer. The issue comes down to what you can actually prove occurred. This could be quite difficult, but I don't want to prejudice your thinking.
You will need to contact a local civil litigation attorney and run all of the facts by him/her. If your emails, etc. demonstrate that there was an agreement, or that the agent was manipulating you in order to get a higher offer from the other buyer, then you may be able to force the sale in your favor.
For a competent lawyer referral, see this link
Hope this helps.