If there is no generic and direct way to do this, any tips on how to code a vimscript function for this will also be helpful.
Yes, this feature is there, but it's a bit hidden. From
[count]v Start Visual mode per character. With [count] select the same number of characters or lines as used for the last Visual operation, but at the current cursor position, multiplied by [count].
So, if you specify a count of 1 (
1v), the same number of character as the last selection had is used, but at the current cursor position.