Don't be too hard on your GP, sleep loss is often a symptom of depression and prozac can really help.
However in your case the sleep loss was probably caused by anxiety and was not very severe. I don't think that taking them for three months will be a problem. Obviously depression is a controversial subject for pilots but this case does not sound bad enough to cause any concern.