Both ways work! Adding it before cooking allows it to provide some flavor to the dish as it cooks. But for presentation purposes, the dish may look better by adding the barbecue sauce after baking! My favorite is to cook it in the sauce and then brush it with more just before serving.