improvisation is simply spontaneous performance without specific or scripted preparation. I have no doubt everyone knows this already, but the point is, you cannot actually 'Do something' for it, per say, or it isn't really improv. and likewise there really isn't any rules per say regarding it, except well, make it sound right, which is ambiguous at best, and meant to be that way. Someone with musical theory will break it down, which with your background and formality I imagine is what you are trying to do, and I can only imagine you would do this by common rules to most music as mentioned above, stay within the feel of the music and simply expand on it is usually safe for improvisation, but there really are no rules, imho. sad thoughts sometimes have happy/aggressive/brooding/angry/mild parts to them. some are completely bi polar in fact. imo music is the representation of life and feeling and to be true in it, I think it is only natural that it would have the same conflicting sentiments. But of course, no one wants to listen to a crazy person who has absolutely no cohesion at all. at least not for long, first few seconds for me at most would be amusing, then it'd get tiresome. And so this is music also right?
The good news is, you have already been improvising in really everything you do, you just really do not notice it, because you have been attempting precision probably in the pursuit of what most define as 'perfection', but in reality you haven;t been precise really. no one is, and you have indeed improvised.
So get to understand the genre and what makes it jazz in the first place. not just the timing, or the key, or progression pattern, etc, but the feel and all the other stuff also. then just do it. you certainly do not need manuscript paper and one could say if you use it, then it isn't improv at all anyways.