Ok, a 2 wire CDI works like this. The magneto produces an AC voltage. The positive going (upper) half of the waveform charges the CDI's charge storing capacitor. As the waveform goes negative (lower half of the wave), it triggers the CDI to fire. It is very early in the negative going half of the wave (like a few volts negative potential) that this happens. There's a bit happening to make the spark at your plug, but that is the gist of how its "timed". Hope this helps. Cheers
Edit; I know this thread was dormant for a couple of months, but seeing as it hadn't been answered how a "two wire" CDI, where there is no crank sensor or firing coil is made to fire I thought I'd explain it, in very basic terms, without going into the electronics of the CDI. Cheers