Not sure about Chrysler ECM's, but generally the ECM supplies a ground to the light. One side of the light is connected to 12V when the ignition switch is in the "run" position. The light bulb is not burned out if it flicks on randomly, unless a condition existed that would normally result in the light being on all the time. If that were true, you'd have a trouble code stored. On the other hand, the absence of a light when the key is turned on, but engine not running indicates a problem. Unfortunately, your first symptoms--random light, would not be logically associated with your second symptom--no light. The "association" may be that you were wiggling wires, etc, trying to determine the source of the first symptom and inadvertently pulled the wires loose for the Check Engine light.
For schematics of your dash and ECM wiring, either buy the appropriate FSM, or check the reference section of your local library; I've had luck finding usable diagrams at my library.