Many States had "Castle Doctrine" as incorporated by case law. South Dakota was one of them. I believe that in 2007, your State legislated the Doctrine into actual law.
Most States that have legislated Castle Doctrine, go a bit further than simply making it lawful to defend your habitation with lethal force. Most also incorporate immunity from criminal prosecutions and civil lawsuits.
Another piece of legislation being incorporated by many States, is "Stand Yor Ground" law. This provides a legal defense against having to retreat from any place you lawfully can be at. Usually, this type of law also attempts to provide immunity from criminal prosecutions and civil lawsuits.
Since these Self Defense laws are generally new, many have not been tested in court.
I don't know the specifics of SD law, so I can't comment any further.