There are two ways to get setting values. I'd highly recommend using the first approach all the time:
Gets the value of the "Page not found URL" setting for the current site. It will default to the global setting is no site specific value is found (inherit box is checked at the site level).
string pageNotFoundUrl = SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".CMSPageNotFoundUrl");
Gets the global value of the "Page not found URL" setting. It will only ever grab the global value and never return a site specific value.
string pageNotFoundUrl = SettingsKeyInfoProvider.GetValue("CMSPageNotFoundUrl");