Under the heading ext-miscdests I would like to add an extra line

exten => 2,2,Background(pls-hold-while-try)

so it looks like this

include => ext-miscdests-custom
exten => 2,1,Noop(MiscDest: Mobile)
exten => 2,2,Background(pls-hold-while-try)
exten => 2,n,Dial(Local/0123456789@from-internal,)
; end of [ext-miscdests]

How would I format the extra line in extensions_custom.conf so that it appears in the correct place

So that changes may be performed via Freepbx with out having to manualy add the line

If you simply put the line into ext-miscdests-custom it will actually appear just where the include line is; but since the Noop line is exactly that, a No-Op line, the effect will be the same as if it had appeared where you show it.

It is an extremely risky business to modify extensions.conf and extensions_additional.conf manually, because then you have to remember to make that change everytime you update to a new release of FreePBx. So where it is not necessary, like here, don’t do it.

If there were actually a line after the include which does something, the easiest way would be to simply duplicate all relevant lines from ext-miscdests in ext-miscdests-custom as well, then the entire call gets handled there and in the right order. Better than modifying extensions_additional.conf.