You don't have to STAY AWAY from her, that's just stupid. The only guys who get friend zoned are guys who are ugly, have no game, or act like complete pussies. I have a friend who I've known for 2 years, we've been very close the entire time, but I actually never flirted with her until the past few months. Was I friend zoned? No. Why? Because I'm not some awkward looking pushover. I always maintained power over the friend zone by being dominant and dropping subtle comments here and there that made the girl want it. Friend zones are for kids in high school who haven't learned how to improve themselves or their game.
If you still talk to her, hang out, etc you must keep up the flirting, kino, etc to insure you do not get friend zoned. She likes you? That's great, but her boyfriend is a jerk and she is still with him, so her word doesn't mean much. Maybe you two will keep hanging out and you end up hooking up, if you do, or if she says she wants to do something like that with you, force her into an ultimatum. Don't let her have her cake and eat it too. If she wants you, make her choose you, not get you and then go back to the boyfriend.
In the end, do your best not to compare yourself to him or force her into choosing because you DO NOT WANT TO COMPETE WITH HER BOYFRIEND. If it's an LTR, you have to be a complete knockout in all aspects to win her over, because what he might not have in looks, game, money, etc he has in time invested with her, which weighs in as a lot.
Best of luck.