The deflection in each cell is twice that which it would be for a Newtonian particle coming in with velocity c. You apply the transverse force to change the direction, multiplying by 2 so as to account for the GR space-space parts of the metric tensor.
This assumes that the matter making the gravity is nonrelativistic (so that you are justified in using a Newtonian potential in the first place), at low pressure (also important, like in normal matter, not neutron stars) and so the light is moving through the field effectively instantaneously. I have assumed the deflection is small, but if the deflection is not small from one end of the box to the other, you are probably not justified in using Newtonian gravity over the whole box.