Personally I'd put the valve at the top near the catch basin and eliminate the secondary line. Just let your excess water run down the ditch versus having it run through a pipe.