I'd say the writers had Asa in mind almost from ep 1 ... but it doesn't mean they didn't just clusterf**k the last five episodes with writing done by randomly pulling dialog out of a hat and rationale even a three year old would respond to with "wtf?".
Here's hoping "The Melancholy of Suzumiya Haruhi" gives us much more quality diversion time