People sometimes say "everybody learns in different ways, whatever you find helpful is ok". But I once saw a music teacher recommending intonation studies to a mandolin player, and the student went off and spent a significant amount of time going through the recommended set of written studies, which were for violinists. Unlike the violin, the mandolin has frets, so its intonation is fixed, so intonation studies simply make no sense.
You mentioned that in an attempt to resolve the problem you were having, you wrote the names of the notes under the stave. That indicates to me that the problem you were having was in relating the written notes to the fingering, sight-reading. It seems to me that a "written improvisation" would demand fairly advanced sight-reading skills. You don't have the tune in your head already, as you would if you were playing the tune "Summertime".
What this exercise won't do I think is help you to improvise.
So I guess it depends what you want to do.