Guiding-function optimization in biased-selection Monte Carlo calculations