Just because a firearm is accurate at long distance, that does not mean that it must be used only at long distance. Even at relatively short distances of 25 yards or less, most people shoot more accurately with a rifle than they do with a handgun.
Now, you'd obviously have some difficult questions to answer if you shot someone from several hundred yards away and tried to claim self-defense, but I don't really see rifle vs. handgun/shotgun being an issue if we're still talking about easily justifiable self-defense ranges.
What may be an issue, however, is the use of a gun that is perceived as a "military weapon" or "assault weapon". While I don't think the use of a rifle in and of itself would be likely to present extra difficulty in legal defense, the use of an AR-15 or AK-47 might be more difficult to defend than the use of a Marlin 336 or Remington 7600. This is because the former two have been labeled by the media and certain politicians as "assault weapons" while the latter two are marketed as and commonly viewed as sporting rifles.
That being said, I've never heard or read of someone being convicted of a crime due to their choice of weapon without some other questionable circumstance(s) being present. However, as has been pointed out, the fact that you're facing trial to begin with indicates that circumstances aren't as cut and dry as you might prefer. I think that the political disposition of your area would probably be a factor as well. For example, someone who defends himself/herself with an AR-15 is likely to be viewed differently in MA or CA than he/she would be in TX or AZ.
Really, there's no universal "cookie cutter" answer here as it all depends on your own unique circumstances. I personally keep and AK-type rifle among my HD firearms, but I live in a relatively firearm/self-defense friendly area and have found my particular rifle to be both easy to shoot well and extremely reliable. In my case, the benefit outweighs the risk. There are no guarantees as people have been able to legally justify the use of very exotic weapons including full-auto rifles and submachineguns while other people have been unable to legally justify the use of relatively mundane weapons such as double-barrel shotguns and revolvers.
If you want an effective rifle that is less likely to be perceived as an "assault weapon", there are choices available. Favorites in this category include the Ruger Mini-14/Mini Thirty and pistol-caliber lever-action rifles such as the Marlin M94 and Winchester M92. If you're comfortable with more powerful rifle cartridges like .243 Winchester, .270 Winchester, .308 Winchester, or .30-06 Springfield, the Remington 750 or 7600 are also viable choices.