This Nuke script was written in Python and is designed to parse through any read nodes selected and find their latest version iterations.
It was developed because at the time(not sure if it still works this way) Nuke's version to latest function would not go to the newest if there was a sequential version missing. Example: if there was v01 v02 v03 v04 v07 it would only go to v04 and then stop.
Rather then using a looped version up and check for exist function, which I assume is what the Nuke one does, I had it pull the folder name that the file was inside of and compare with all the files in that directory first for the same name. Then to find the highest version and then set that one as the filename.
Sidenote: I wrote it specifically for the workflow and folder structure at Bent Image Lab so some modification is probably required to get it to work with your workflow.
As usual it's called using something like the below lines in Nuke's menu.py file
nuke.menu( 'Nuke' ).addCommand( 'Node/Filename/Version to Latest (Reads only)' , 'import versionToLatest; versionToLatest.versionToLatest()')