When you stop thinking about it.
I just took a hiatus from Iwaku for a while (and, who knows, maybe I'll vanish again for a while after today. We'll see where the wind takes me). And if I was counting down the days, still constantly thinking about Iwaku, like, "is it time?? have I been gone for long enough?? Is it ok to come back now??" then the answer would definitely be no. Anytime I found myself thinking about Iwaku during that break, my immediate reaction was "noooope nope nope nope. I left for a reason. Going back now would NOT be good for me. No matter how many unresolved Emotions™ I still have"
And so I stayed away, with basically zero desire to come back, except for those moments when I got emotional about it (which were all signs to me that I should definitely not come back).
But this morning I was like "lol I should log back into Iwaku just to change my status message to 'hey pee-brain can you teleport'". And so I did. And then I was like "I should poke around the forum some more and see what's up."
And it wasn't a big deal to me. I just felt like poking around. If it starts to become a big deal, then I might have to stay away for a while again. But, when I was able to pop back onto the forum without really thinking much about whether it would be the right time? When I really didn't have much emotional investment in the situation and I just wanted to see what was going on? That's when it was the right time.
I know you were mainly talking about when it's right to come back from a hiatus for writing (and roleplaying), whereas my hiatus was more about taking a break from a community that was taking a real emotional toll on me. But either way, I think the point remains. If you're still thinking about writing/roleplaying, and wondering when it's ok to go back... then I think you still need time. If you're just doing other things with your life, not thinking about writing/roleplaying, until suddenly inspiration strikes and you want to get back into it? I think that would be the right time.