Learning how to maintain a role-play will take time and practice. I've had so many die on me (for various different reasons, some more recurring than others) before I've managed to keep a role-play alive for a relatively long period of time. So, first and foremost: just practice at being a GM. Do it again and again, and when you're not GMing, observe how others do it and see if it's effective.
But here's a few tips to get you started with:
Long gaps between posts will definitely kill any roleplay. You want to maintain a consistent posting speed all throughout and also be consistent when people fail to meet the posting requirements. Sometimes, this means making hard decisions, like removing people with important characters or perhaps even having to kick out friends. And you'll probably have to kick out a lot of people, or they'll likely drop out of their own accord.
In that case, make sure you don't run out of players. Have a target size in mind, then add a few extras just to be safe. Open your roleplay to newcomers at intervals, or keep them open indefinitely. Your choice. But a bigger group means harder maintenance, and more tendency of people clashing with each other, so that's another thing you need to keep in mind.
You'll also have to keep the action going for any role-play to thrive. Plan ahead, brainstorm with your fellow role-players if that's what'll get the creative gears churning. Add conflict, spice things up, involve everyone and make them feel they have something to contribute to the story.
Out-of-character chatting also works wonders. People write better when they know who they're writing with and when they're at least somewhat involved in the planning process. An active chat hypes people up and provides a sense of community.
Lastly, listen to your role-players. You don't have to do everything they want you to do. You're the GM after all and you make the last call. But in the end, a group role-play is a team effort. You want to make sure everyone is heard and their ideas are considered, even if some ideas are ultimately not given the green light.
And just be confident. When you act like you know what you're doing, people will learn to trust you as their GM and there is a lot less hassle that way.