Safest and most \"Americanized\" part of Lima
My wife is from Peru (Lince District in Lima) and I am headed down there for the fifth time in December, for a three-week stay. Miraflores is definitely one of the cleaner and safer areas in Lima. If you don't like seeing poor, crowded, dirty places, stay within Miraflores. Miraflores has nice restaurants, malls, nice parks, and a gorgeous view of the sea at Larcomar. But don't go down there expecting Miraflores to be like downtown Chicago or New York, because it's not. That being said though, I could definitely see my wife and I buying an ocean-view condo in Miraflores during our retirement. Other nice areas in the city include San Isidro and La Molina.
Personally, I love the whole city of Lima (and all of Peru that I've seen, for that matter). Yeah, most of it's dirty and poor, but I love getting away from the US for a few weeks at a time, and being in a place where nobody's worried about "keeping up with the Joneses". Everyone I've met there is so welcoming and inviting. People seem to be happier in general, than Americans. I haven't met anyone there during my visits with the common American attitude of "if you don't speak our language, I'm not even going to try to talk to you". It's been quite the contrary. Most people I've met in Peru have been anxious to help me with my Spanish or at least try to communicate with me (I'm not 100% fluent, but close now).
In terms of where to stay...if I were planning a trip to Miraflores and staying for a week or more, I would book the first maybe two nights in a hotel so you know for sure you've got a place to stay. Then the first day or two, I would look for other places to stay that may be cheaper or in a more preferable location (i.e. with an ocean view). Everything is so much cheaper down there. A lot of places you'll find on the internet though may seem to have typical American prices. Some things will surprise you as to how cheap they are...one of them being lodging. I've never stayed in Miraflores. I've always stayed with either my wife's family in Lince or a friend's family in San Borja when staying in Lima. But other places I've stayed in Peru include Mancora (beachfront hotel with a pool for $29/night) and Cusco ($85 for an entire week in a nice hostal just a couple blocks from the plaza de armas). So don't lock yourself into an expensive place if you're willing to venture out and look for something a bit cheaper. And if you don't find anything else you like, you can always extend your stay at your hotel.