Hi Stevec.
With proper settings, CodeWarrior will detect correct clock trim variable for the actual cpu and will write it into a default location in flash when you'll upload your program in flash.
Just copy this variable in the right register at the beginning of your code and the clock will be precisely set. On 9S08AW60 I achieve nearly 0.5% precision at ambient temperature this way. For this uC the first 2 line of ASM code in my program are:
lda OSCTRMDEFAULT ; load CW detected trimmer variable from default location
sta OSCTRM ; Preset oscillator trim factor, writing the clock trimmer register
I think that this may be the same for 9S08QG8 (see your default 9S08QG8.inc and the data sheet for the variable names and locations)
Bye,
Encoder