Electronic structure of many-electron square-well quantum dots with and without an attractive impurity : Spin-density-functional theory