It is very rarely a good idea for a listing agent to place an offer on a property they have listed in NYS, as it opens them up to a TON of liability. I would never do it myself.
1. Discloses the facts to the seller (That he/she has the intention to buy the property)
2. Markets the property in a fair way to and publicly where it's available to other buyers (If that's the sellers wish)
The only grey line is where there is another offer on table and the listing agent really wants the property! Then they can just go a bit over the highest offer and conclude the transaction in their own favor. This situation is inevitable and seems unfair but it can happen and it is not against law.
If I find myself in this situation, considering my fiduciary duties as an agent towards my seller and my ethical standards I will ask the buyers agent to present the offer to the sellers him/her self. This way both offers get a fair option to be looked at and the seller as well as other buyer get a better feelings of all parties clear intentions. Ultimately the seller is the one that makes the decision and if they want they still can work the deal in favor of the listing agent.