Hopefully I am not too late to help you!
We make sure we are in Frontierland at least 30 minutes before the show starts The fireworks are mostly continuous throughout the show, but are especially heavy in the last five minutes, which helps your chance of seeing them while on the ride. Then you have to do some quick simple math. If the wait time on the ride is 15 minutes or less. You will have a good chance if you get in line right before or at the start of the show. If the wait time is 20 minutes or more, you will need to get in line early. If the show starts at 8pm and the BTMM wait time is 30 minutes, you should get in line around 7:30-40pm so that there is a good chance you will be on the ride during the show.
Lots of variables here, of course. The biggest being the listed wait time being accurate and the line moving along efficiently. After some trial and error you will start to get a feel for the right time to get into line.