We measure the time-dependent $CP$ asymmetry in the radiative-penguin decay ${B}^{0}\ensuremath{\rightarrow}{K}_{S}^{0}{\ensuremath{\pi}}^{\ensuremath{-}}{\ensuremath{\pi}}^{+}\ensuremath{\gamma}$, using a sample of $471\ifmmode\times\else\texttimes\fi{}{10}^{6}$ $\mathrm{\ensuremath{\Upsilon}}(4S)\ensuremath{\rightarrow}B\overline{B}$ events recorded with the BABAR detector at the PEP-II ${e}^{+}{e}^{\ensuremath{-}}$ storage ring at SLAC. Using events with ${m}_{K\ensuremath{\pi}\ensuremath{\pi}}<1.8\text{ }\text{ }\mathrm{GeV}/{c}^{2}$, we measure the branching fractions of ${B}^{+}\ensuremath{\rightarrow}{K}^{+}{\ensuremath{\pi}}^{\ensuremath{-}}{\ensuremath{\pi}}^{+}\ensuremath{\gamma}$ and ${B}^{0}\ensuremath{\rightarrow}{K}^{0}{\ensuremath{\pi}}^{\ensuremath{-}}{\ensuremath{\pi}}^{+}\ensuremath{\gamma}$, the branching fractions of the kaonic resonances decaying to ${K}^{+}{\ensuremath{\pi}}^{\ensuremath{-}}{\ensuremath{\pi}}^{+}$, as well as the overall branching fractions of the ${B}^{+}\ensuremath{\rightarrow}{\ensuremath{\rho}}^{0}{K}^{+}\ensuremath{\gamma}$, ${B}^{+}\ensuremath{\rightarrow}{K}^{*0}{\ensuremath{\pi}}^{+}\ensuremath{\gamma}$ and $S$-wave ${B}^{+}\ensuremath{\rightarrow}(K\ensuremath{\pi}{)}_{0}^{*0}{\ensuremath{\pi}}^{+}\ensuremath{\gamma}$ components. For events from the $\ensuremath{\rho}$ mass band, we measure the $CP$-violating parameters ${\mathcal{S}}_{{K}_{S}^{0}{\ensuremath{\pi}}^{+}{\ensuremath{\pi}}^{\ensuremath{-}}\ensuremath{\gamma}}=0.14\ifmmode\pm\else\textpm\fi{}0.25\ifmmode\pm\else\textpm\fi{}0.03$ and ${\mathcal{C}}_{{K}_{S}^{0}{\ensuremath{\pi}}^{+}{\ensuremath{\pi}}^{\ensuremath{-}}\ensuremath{\gamma}}=\ensuremath{-}0.39\ifmmode\pm\else\textpm\fi{}0.2{0}_{\ensuremath{-}0.02}^{+0.03}$, where the first uncertainties are statistical and the second are systematic. We extract from this measurement the time-dependent $CP$ asymmetry related to the $CP$ eigenstate ${\ensuremath{\rho}}^{0}{K}_{S}^{0}$ and obtain ${\mathcal{S}}_{{K}_{S}^{0}\ensuremath{\rho}\ensuremath{\gamma}}=\ensuremath{-}0.18\ifmmode\pm\else\textpm\fi{}0.3{2}_{\ensuremath{-}0.05}^{+0.06}$, which provides information on the photon polarization in the underlying $b\ensuremath{\rightarrow}s\ensuremath{\gamma}$ transition.