The Rename line is likely running on the old selection, not the new one.
(While something similar might work with the internal Select command, it's generally not recommended. With a script add-in external command like SelectEx it's even less likely to work.)
As a general rule: Don't change selection with one command just to alter which files another command runs on. Change the selection if you want to change which files are selected for you in the UI, not for other commands that are part of the same button. Commands can be told which files to use directly, without messing with what's selected.
Having said that, if you don't mind the button messing up which files are selected in the UI, then a quick way to make it work is to run the Rename line as a second, separate command:
SelectEx NTH 2
dopusrt /acmd Rename PRESET="presetX"