The haunted house is the same house in which Mayor Stoner, Clara Johnson, Reverend Tucker/Martin, and Mrs. Wiley lived. It was re-dressed to look like the rundown Rimshaw place for this episode. On the 40 Acre back lot it was known as the "Aunt Pitty Pat House," since it was also used as Aunt Pitty's home in Gone With The Wind (1939).
The scene involving Otis' jump rope sobriety test was intended to be the epilogue, but the screenwriter felt that it ran too long and would be better suited to fit within the main story.
The original script called for Barney to actually faint after seeing the floating ax, but the director felt that it would have been too broad for the moment. So, he went with the idea of Barney nearly fainting and then being brought around by Andy.
Besides being used for Mayor Stoner's house in previous shows, the Rimshaw house was also used for the home of Reverend Tucker, and socialite Mrs. Wiley, Mayor Roy Stoner, and Clara Johnson. It sat directly to the right of the Taylor home on the 40 Acres backlot, which was kept out of the frame during shooting.
In the opening shots where Opie and Arnold argue over going after their lost ball, the little house in the background is the same backlot set used for Frank Myers' house in "Mayberry Goes Bankrupt" from season two. Remnants of the town-decorated window shutters can still be seen.