Highly active and stable substrates for surface-enhanced Raman scattering (SERS) can be fabricated by using colloidal crystals to template gold nanoparticles into structured porous films. The structure-dependent performance of these SERS substrates was systematically characterized with cyanide in continuous flow millifluidic chambers. A matrix of experiments was designed to isolate the SERS contributions arising from nano- and microscale porosity, long range ordering of the micropores, and the thickness of the nanoparticle layer. The SERS results were compared to the substrate structure observed by scanning electron microscopy (SEM) and optical microscopy to correlate substrate structure to SERS performance. The Raman peak intensity was consistently highest for nanoporous substrates with three-dimensionally ordered micropores, and decreases if the micropores are not ordered, or not templated. Removing the nanoscale porosity by fusion of the nanoparticles (without removing the large micropores) leads to drastic plunge in substrate performance. The peak intensity does not strongly correlate to the thickness of the nanoparticle films. Receiver operating characteristic (ROC) curve analysis for cyanide in water revealed a limit of detection (LOD) of ca. 150 ppb based on a 5% probability of false alarm. The results make possible the efficient controlled fabrication of stable, reproducible and highly active substrates for SERS-based chemical sensors with continuous sampling.