Just looking at something like your last example, this will replace a number with double its value:
s/\d\+/\=submatch(0) * 2/
This is known as a sub-replace expression and I go into some depth here, though with an emphasis on string operations: How to run a substitute command on only a certain part of the line
The key is
\= which says "everything after this point is to be evaluated as an expression and the result of that evaluation becomes the substituted string".
submatch(0) represents the entire matched string. If you use capture groups
\(...\) then you can refer to their matched parts with
s/\v(\d+) (\d+)/\=submatch(1) * submatch(2)/
Will replace two numbers separated by a space with their product.
Beyond that it's pretty much anything goes. You're running vimscript in there so you can call functions, do arithmetic, manipulate strings, and so on.