Your request is pretty specific and I'm not sure I know of a drama that has all those specificities. But I've watched a few where the female lead is engaged/married while loving another one. As for how it ends, well it depends. :)
Que sera sera (the involvement with another comes at a later point in the drama and so I don't wanna spoil it to someone who might plan to watch it). Anyway, she's dating the main lead, then something happens and she gets closer to the second lead. When she realizes that she may have made a mistake it's almost too late. And the main lead has to watch her (from up close!) be with another guy.
In Summer's desire the female lead gets engaged to someone while loving her (recently) ex-boyfriend. I didn't see the end so I don't know if she goes back to her lover.