Writing fictional stories with a message
It is permissible to write fictional stories if they have a message and promote goodness and righteousness. As for using the texts of the Qur’an and Sunnah in the stories, if it is done in an appropriate manner, it does not seem that there is any reason to disallow it. See the long answer.
18,151