Hi there!
1) Are pre-written stories allowed? Yes! Jams shouldn't be a competition, just something fun to enjoy while you make games. So yeah, you can use your pre-written stories. Try to do something different gameplay-wise, it's always more fun to try out new things.
2) Can I use existing code? Sure!
3) Can I submit more then one story? As many as you want!
4) Can I make text-based adventure at all? Text adventure, pen and paper, VR, alternate reality, traditional videogames or whatever you feel it's right.
5) Will it be a must to share the code? Nope! It's always cool to share it but it's your choice.