I don't think you can do this with repeat_formula. I believe you can only replace cell references with other cell references. Some evidence for this:
IV65536 is the cell reference for the last possible addressable cell. It seems that this is used whenever the replacement string cannot be parsed as a cell reference.
In the documentation for the module it states that repeat_formula()"does not modify the tokens." I suspect this means that the type of a token cannot be modified, only their names can be modified. So you can't change a cell reference into a constant.
Note that the most likely use of the repeat_formula feature of the Excel spreadsheet format is to accommodate the fill-up/down and fill-left/right operations. In those cases you are only replacing cell references with other cell references.
I would ask the maintainer of the module for confirmation of these ideas. As a workaround, you probably have to store the result of the calculation ($diff) in a cell and reference the cell.