The paste is here, but since the not working part is only one line I'll paste it here
The code used to work perfectly, but as it always is, I changed something a hundred lines up and now that line doesn't work. For a while it used to move the last created object, but now I force deselect created objects after I'm done processing them. When the code runs, it generates everything correctly and all objects that should be selected are selected, but it doesn't snap to the cursor. I know that it should work not only because it used to but also because after the code runs I can just move the mouse over and do the command manually, but that's not the point of having an autonomous script. It may also be worth noting that no other view3d functions seem to do anything either, no errors but no effect.
Upon further testing of printing what ctx to the console, the objects show up so it should be the correct context.