Well, if you want to be witty, you have to be witty all the time, with all kinds of people at times when the oppurtunity is ripe.
Acting in a different manner than you usually do should not be tried unless you can assimilate the change that you are trying to incorporate into your life to a great extent.
First off, are you naturally witty but get tongue-tied in front of girls?
Or are you not able to liven up conversations even with your mates?
If its the first case, then I would have to say that you are lacking a bit of confidence at interjecting witty remarks because you are afraid of what the girl might think!!!
To overcome this problem, you should try to improve your confidence levels.A good way to start off is by going through Mr.Finger's post on "Authentic confidence" .Reading the post is the easy part, implmenting it would be tough.And do not expect results overnight.It will be a slow change which you shall notice as the time goes on.
If its the latter, then you would have to bring about a radical change in your mindset.Start listening to stand-up comedy.Or if any of your friends are witty by default, you could observe how and when they slip in the repartee.
Before trying to use witty lines with a girl you are quite interested in, try to incorporate the changes in such a way that you become witty by default.Start off by being witty with your friends and family and see how it works out.If you need to oil your machinary a bit more, then spend more time on it before you become a full-fledged "Witty" Allen.
Good luck....