When to prefer maximisation of surplus and when instead to prefer minimising differences in price and q to find market equilibrium?
Market Equilibrium occurs when the difference between demand and supply is minimized. Equilibrium price and quantity is determined by solving this problem.

Surplus Maximization (or efficiency) is a property that we would want equilibrium to have. First Welfare Theorem says that in competitive markets (in the absence of externalities) market equilibrium is surplus maximizing. In standard demand-supply framework, solving for equilibrium and efficiency yields identical outcomes, and that is why these methods are used interchangeably.