There has been at least a very popular thread here about this practice, but i can't find it back for you...
You can find lots of information about " writing induced lucid dream"