For example, given the reaction below:

The substrate is secondary, the solvent is aprotic and it is to react with a strong bulky base. From this, I assumed that the reaction would be EX2. However, it instead begins with an acid-base reaction where the tert-butoxide removes the proton of hydroxide and then proceeds with a SnX1 reaction where the oxygen attacks the carbon of the leaving group to form an epoxide.
How can you determine if an acid-base reaction will take place before proceeding with a substitution reaction?