The moment of inspiration can come from memory or language or the imagination or experience - anything that makes an impression forcibly enough for language to form.
The best time to frame an answer to the letters of a friend is the moment you receive them. Then the warmth of friendship and the intelligence received most forcibly cooperate.