Hi Keren,
this is already possible, through the class CodonDistanceFrequenciesSubstitutionModel.
This codon model is similar to YN98 model, but can take any nucl model, and even 3 different
nucl models, one per position.
In bppml, it is called like:
model=CodonDistFreq(model=JC69(), frequencies=F3X4())
Beware that if the nucleotide model has a non-uniform equilibrium distribution,
there will be indentifiability issues with the parameterized frequencies.
Cheers,
Laurent