The gate to the prison is actually the entrance to Paramount Studios.
The shots depicting Barney (Greg Morris) climbing down an elevator shaft in this segment are examples of the re-use of existing footage on the show - most of it was taken from the Season 3 episode "Doomsday," which also involved the extensive use of an elevator shaft.
There are four Star Trek alumni in this episode: Lee Meriwether (Losira in That Which Survives (1969)), Logan Ramsey (Proconsul Claudius Marcus in Bread and Circuses (1968)), Jack Donner (Subcommander Tal in The Enterprise Incident (1968)), and of course Leonard Nimoy.
The movie trick used by Phelps in Stephan's cell was based on an actual nightclub act the show's writer Paul Playdon had seen years earlier. Playdon recalled the routine opened with a film of the star who, by standing behind a screen and jumping through it at the right moment, seemed to "leap off" the screen. But methods used to translate that to film for the show proved ineffective, so a matte shot was finally used instead.