@set will trim spaces off the start/end, but luckily there's no need for @set to be used with the thing you don't want to be trimmed, so you can do this:
@nodeselect
@set brace1={
@set brace2=}
@set position={dlgstring|Enter character position to replace...}
Rename REGEXP PATTERN "^(.{$brace1}{$position}{$brace2}).(.*)" TO "\1{dlgstring|Replace with...}\2" AUTORENAME TYPE=files
How would I modify this to address multiple characters. Say I want 2nd and 3rd character. I tried this old: ^(.{2-3}).(.*) new: \1x\2 but that didn't work.
I'm not sure why it would do that, but these days I would write a script rather than fight with @set and {dlgstring} if they aren't doing what you want with a basic command.
That will let you apply more complex/clever logic for the rename as well.