It all depends on the kind of RP.
As for RP'ing in a mud, (since this usually takes a direct reply) the more you stick in character, the more you'll know about your character too, and it will be easier to find out how they'll react to a certain situation.
Yet, if you find yourself stuck, buy yourself some time. Have your character do something unexpected like sneezing, or some other funny thing or look around in the room where you're at.
Maybe there's something in the description that can suddenly attract your character's attention and you can start talking about that, while in the mean time you think on how you can react on the situation that got you stuck in the first place. (With some luck, perhaps you don't even have to react to that situation anymore at all.
)
Or if there's an NPC/MOB in the room, you can use the pose-command to have that mob interact with you and the surrounding people. Or ask one of the RPL's to take on the role of the mob/npc.
As for non-mud-related RP or the writer's block you're describing, if you're not pressured in time to react, do something completely different. Go out, have a drink, visit friends, go watch a movie, read a book, or as for writing an RP-story, read other examples, that might give you some ideas. Or, talk about it with someone else. Brainstorming with other people can bring up ideas too.
Also in order to learn more about your ingame character have a look at the following webpage:
http://4dimensions.org/node/RPPointers, mainly at point 2 'Never confuse roleplay with real life'. Maybe answering those question from your character's point of view will also give you a better understanding of your character.
And there's more tricks other people use to develop their character. But I'll leave that to those to post.