I found out recently that there's no Moodle equivalent for the SQL syntax:
UPDATE tablename SET fieldname = fieldname+1
So I sat down and wrote a new function which I called "renumber_field" that does just that.
It gets table name, fiend name, amount, increase/decrease indicator and the usual conditions array.
I created an issue with an implementation for mysqli and it was suggested that I post it here to see if there's any need for the new functionality, so i'll be happy for any feedback