Optimization of soliton ratchets in inhomogeneous sine-Gordon systems