Hello,
Yes, you need to incorporate the step down and tool diameter as a parameter that then changes your toolpath.
For a slot, as you did it, an easy approach is to offset the relevant sides and then extrude the volume that needs to be removed. You can then make e.g. contour lines through the object and put them into a zig-zag pattern.
Somehow related, attached is another example we did a while ago for a wood connection.
As always with programming, there are countless ways to get there, there is no "ideal" way.
Best,
Johannes