I keep a guitar around while writing and will improvise music. I do this for several reasons, such as that it's fun, and sometimes it helps me with the meter. ↗
That's the beauty of music. You can take a theme from a Bach sacred chorale and improvise. It doesn't make any difference where the theme comes from; the treatment of it can be jazz. ↗
Jazz stands for freedom. It's supposed to be the voice of freedom: Get out there and improvise, and take chances, and don't be a perfectionist - leave that to the classical musicians. ↗
There are times when the writers ask us to improvise. Sometimes the animators are inspired by what you do, and sometimes you are inspired by what the animators do. ↗
So, for instance, if you came to me, I'd ask,'Do you want to write? Do you want to improvise? Why do you want to play this instrument? What do you want to do?' ↗