Great read, Cindy. First of all, there is no need to apologize to John. Although you may have been looking for an ego boost, John sounds like a manipulator (I see him playing with your feelings, more than the other way around) and he was likely hoping to take advantage because you were seeking attention, even though you told him you weren't interested.
Male and female friendships and expectations can be complicated, especially when we don't really know "the rules" up front.
It's brave of you to share this story as many women (of all ages) feel the need to flirt (and some do) because they want to feel like they're still attractive to other men apart from their husbands.
It was good insight to stop, draw the line and to come forward with your self-awareness and honesty to share your story with other women. At the end of the day, casual flirting can be fun and harmless and give both parties an ego boost, as long as we know when to stop, and pay attention to any red flags.