Most likely the device under the carburetor is a water sensor, and it should be connected through the mower's wiring harness to the starter solenoid or to the engine kill switch wiring, as part of a safety circuit that may also include seat, clutch and deck height sensors. Your old engine may also have had a water detector, and this is just the new version so it should connect to the same wire as the old one. So far as wires from the cowling are concerned, there must be a kill wire somewhere, and an output wire from the generator. B&S kill wires are traditionally black, and you have not mentioned a black wire.

My guesses cannot replace proper manufacturer's information. You need the wiring diagram from the Cox workshop manual, and for the Intek engine, you need advice from an experienced B&S dealer, or at a pinch, tracing and/or testing each wire.