No, that expression is not a good one for that situation. “Not get boxed in” means “make sure that you have choices/options available.” Example: ‘I don’t want to buy an expensive house because that will box me in to staying in a high-paying job that I don’t like, and I won’t have the freedom to choose a lower-paying job that I like better.” For your situation, “better safe than sorry” would be a good expression. “I decided to overprepare for the test to make sure that I get a good grade. Better safe than sorry!”