On the Optimal Control of a Random Walk with Jumps and Barriers