Optimal excitation transfer in two-dimensional lattices of Rydberg atoms