Ayase chose the best moment for her confession. Kyousuke on his part did the right thing, from my point of view. He loves someone else. He doesn't love Ayase the way, he loves the other person. Ayase doesn't deserve a boyfriend, who doesn't cherish her like the most important person on planet.
Still... Kyousuke and Ayase would have made a good couple.