To my understanding and according to Wiki's explanations, the coloured light is emitted by lone metal atoms in the flame. It's the reason why the colour lets identify the metal independently of the compounds it makes.
So there is no chemical reaction to write for it. Just gaseous Cu atoms for instance, which are released in an excited state because a flame is a violent reaction, and these atoms emit light as they change to a state not or less excited. Other processes exist for other elements, where molecules and radicals can emit most light, for instance OH, CO2 or solid C.
Metals are more efficient than other elements to colour a flame. The minuscule vapour amount of a solid grain of NaCl hold in a hydrocarbon flame suffices to give the flame the Na colour. The reason of this efficiency isn't perfectly clear to me, but it makes the flame test a means to identify the metals.
Atoms of each element can radiate a limited series of wavelengths that characterizes that element. This series can't be computed by hand from the filling of the electron shells. Also, only some wavelengths are visible, and which ones are depends on the metal. Finally, our eyes analyse colours with red, green and blue bands only, and we reconstruct more colours from only three intensities and depending on our culture. As a result, the flame colour of each metal should be understood as experimental data, whose justification works but needs lengthy software modelling.