This is an interesting question.
It might be possible to mist the coffee beans with the vanilla extract prior to roasting but not sure how well it will carry over?
It might be better to mist after roasting?
I have added home made vanilla paste directly to the grounds prior to brewing (tends to not work with coffee filters tho) or added extract to coffee.