extract duplicated code into UpdateVersionsInFile function

As I reviewed the implementation of assign version feature I saw this duplication of code and thought, well that is a good opportunity to practice refactoring in F#. And here we go.