Some of my old posts from another site I use to regulate. Unfortunately its geared more towards 2t. 4T is easier actually.
Generally, when in-cylinder temperatures increase, so do exhaust port temperatures. The exceptions to this are caused by things like having a lot of blowthrough at TDC following the exhaust stroke, where you get a lot of fresh air flowing through the top of the cylinder and straight out of the exhaust port. This obviously has a cooling effect on the gases being scavenged, and is most pronounced in 4-strokes when using a wide-overlap camshaft (often used specifically for this purpose), and in 2-strokes where the combustion system geometry has been designed to optimise scavenging.
Now, the effect of mixture on EGT:
With a very rich mixture, exhaust gas temperatures will be low. This is down to a number of factors, but the absence of sufficient air for complete combustion is the main factor. The flame front simply dies out. Also, the excess fuel has a high specific heat capacity, and is able to 'mop up' further heat, particularly in something like a Diesel engine where there are still fuel droplets present (the evaporation of these droplets requires energy input, thus lowering the surrounding temperatures). CO rather than CO2 is produced due to the partial oxidation of carbon in an oxygen deficient environment. This CO is then further oxidised to CO2 later on in the combustion process (say, when both valves are open, and there's a sudden influx of fresh oxygen). This resulting oxidation of CO to CO2 requires energy input, so temperatures are again reduced.
Moving on to leaner mixtures, more air is available to sustain a more complete combustion, and more fuel is burned, and temperatures rise, to a peak, when all the fuel is burned (obviously all the chemical energy held within is released as heat). The effects mentioned previously decrease, particularly as the oxidation of carbon is complete. Leaner still, there's excess air, which serves to dilute the hot combustion gases, and temperatures again start to decrease.
This is all quite high-level; there's rather a lot more with regard to heat release rates.
As for why detonation generally only takes out one cylinder:
The line between detonation and no detonation is extremely fine. It can take just a few degrees extra in cylinder temperatures, or a few tenths of a degree crank angle too advanced (for spark/injection) to cause detonation. As a result of cooling channel designs, and slight imbalances of flow between different inlet tracts, (not to mention different AFRs cylinder-to-cylinder caused by tolerances on the carburettors), all the cylinders very rarely operate at exactly the same timing/mixture/temperature. If you have a bad detonation, and take off the top of the piston on one cylinder, your engine will probably catastrophically fail pretty quickly on one cylinder before the others have even had chance.
As for what EGTs would do to warn you of detonation, well, I wouldn't rely on using them as an indicator. Firstly check your mixture. Secondly make sure you're not running at some silly advance anyway, and thirdly listen out for detonation. If you've set the engine up properly in the first place then there's no reason for it to start detonating during use. However, whilst leaning out during setting your engine up (and we're talking sensible AFRs here), you'll notice the exhaust temperatures rise, peak, and then start to fall. As you said, when they're falling, there's a good chance your detonating. This is because the shock wave caused by the detonation breaks up the boundary layer of relatively stagnant mixture which normally 'lines' the cylinder walls. As a result, the thermal transfer between the combustion gas and the (normally rather cool) cylinder walls (and by proxy, piston) rocket, until you start siezing little chunks of piston land to the bores and ripping them off. The exhaust gas temperature decreases when detonation occurs because some of the heat which usually goes out of the exhaust ports goes straight into the cylinder walls. So it's important to distinguish between exhaust gas temperatures (which essentially indicate mixture; the peak temperature is at stoichiometric) and 'general engine temperatures' (coolant and oil) which are drastically affected by any changes in friction between the piston and bore/liner.
Pre-ignition is when combustion (the rapid progression of a flame front through the end gas) occurs before (in time) the spark. This can be due to a number of factors, generally by 'surface ignition' where the charge is ignited by a hot surface (often a hot valve, the spark plug, or a hot spot on the bore or head, and occasionally by a glowing carbon deposit somewhere in the chamber). Note that surface ignition can also occur after the spark event; this is known (surprisingly enough) as post-ignition.
Knock (or detonation) is spontaneous combustion of some of the charge ahead of (in distance from the spark plug) the advancing flame front. (I'm assuming here that you understand (or can imagine) how a flame front propagates from the area around the spark plug, if not please shout!). As this flame front propagates, the gas which has not yet been ignited, is compressed, and as a result its temperature and density increase. If the conditions (temperature, pressure, density) of this unburned portion of mixtue are right for combustion, then ignition will occur. This resulting combustion advances MUCH (5 to 25 times) faster than the 'normal' flame front, and is sometimes severe enough to cause catastrophic failure (as I described earlier). This rapid combustion causes a high-pressure shock wave which gives knock its characteristic (onomatopoeaic!) sound. Knock occurs when this secondary, spontaneous ignition occurs before the flame front has reached it. In effect, there's a race between the normal flame front (propagating from the spark), and any auto-ignited areas of charge.
So, surface ignition (usually in the form of pre-ignition) can cause knock, by causing an abnormal combustion event ahead of the flame front. If the spark has already occured, and a normal combustion event taken place, but knocking occurs, this is known as spark knock, i.e. it has not been caused by surface ignition.