Theory of domain walls in ordered structures—II: Pair approximation for nonzero temperatures