"If I Fell" was recorded by the Beatles in EMI studios on 27 February 1964, when they did 15 takes. Some time prior to that, however, Lennon recorded a home demo that in some ways is very similar to the finished product, and in other ways is very different.
Unfortunately, there is no way of knowing the date on this home recording, although logic would suggest prior to 27 February 1964, given that that's the day the band recorded the tune in the studio. But even that is questionable due to the fact that the intro was absent from the first 10 takes (Lewisohn, page 40). If the intro was written before the studio recording of the song, why is it absent from the first 10 takes? Why take it out? The obvious answer would be that when they started work on the song, the intro had not been written yet, they realized it needed a little something that the beginning, and therefore wrote it in the studio between takes 10 and 11. But then what of Lennon's demo? It seems highly unlikely that John would have recorded a demo after finishing recording it in the studio - that would, after all, defeat the very purpose of the demo. I suppose the demo could be forged (this wouldn't be the first time), but I suspect it is legitimate.
Further complicating things, Paul McCartney has recently claimed the introduction was his idea - not Lennon's (Q magazine, May 2013), which seems to support Lewisohn's observations, but contradict Lennon's demo. But at the same time, P McC is notorious for rewriting history. On the other hand, Paul used a half-step modulation in "And I Love Her" (from C-sharp minor to D minor) that is similar to the modulation between the introduction and body of "If I Fell" (E-flat minor to D major). Perhaps Paul, pleased with the half-step key change he had just used in "And I Love Her", reprised the concept (but inverted - going down rather than up) for the intro to "If I Fell". But there, again, how do you account for Lennon's demo?
Bottom line: Unfortunately, the only conclusion that can be drawn given this evidence is that we simply don't know when the intro was written, nor who wrote it.
Lewisohn, Mark. The Beatles Recording Sessions. Harmony Books, New York, NY, 1988.