Origin of "You've got nice ... here. It would be a shame if something happened to it"
It appears to derive from mafialike intimidating expressions whose earliest known usages date back at least to the '20s:
Gangster-type intimidation repeated often in the movies is: “Nice place you got here. Be a shame if anything happened to it.” (Or, “Nice place you got here. It would be a pity if anything happened to it.") The message is that the speaker can make life difficult for the listener if the listener doesn’t go along with the program (such as paying extortion money).
The origin of the phrase is uncertain, but it’s cited at least once in the 1920s and regularly since the 1960s. The phrase is often associated with New York City.
The phrase became newly popular in 2009 with the presidency of Barack Obama, who some accused of using “Chicago-style” thug tactics to win support for his programs.
Early usage example:
9 August 1926, Ludington (MI) Daily News, “Detroit Bandits Use Psychology in Bank Robbery. Pick Cashier Up on Street and Bring Him to Verge of Hysteria by Questions,” pg. 1, col. 7:
“How are your children now? You think a lot of them, don’t you? You have a nice little family, haven’t you? Wouldn’t it be a pity if anything happened to break it up?”
From (www.barrypopik.com)
Shame if something happened from "tvtropes.org":
This is a common stock phrase used by thugs (usually The Mafia) in extortion rackets. "You've got a nice (noun) here. It'd be a shame if anything were to... happen to it."
Often parodied: the Big Bad will threaten the hero with some minor inconvenience, and it will be treated with the same seriousness as a death threat, if not more seriously.
In linguistics, this sort of threat is known as a Gricean Implicature. Note that another even subtler way to make this kind of threat is to assert hope that some situation will proceed normally as though there were some reason for it not to: "Cute kid you got there. I hope she'll grow up to have kids of her own and live to see a ripe old age."