I have a script that can delete one or more named ranges. However, the sheet does not recompute either after the script finishes or after a flush command is given. The only way
If the action taken upon the spreadsheet has no impact on any formulas, then there will be no recalculation. Deleting a named range, for example, has no recalculation impact unless that named range is referenced in a formula. (And if that's the case, then the spreadsheet was probably broken by the deletion.)
Spreadsheet.flush()
does not force recalculation - it's only supposed to write pending changes to the spreadsheet. (And if that change doesn't affect formulas... you get the idea.)
The net result is that you're left with the solution you describe; you need to update a cell that's involved in calculations. Replacing a formula will do. Sorry, no magic incantation for this.
Actually, INDIRECT skips dependencies, and always recalculates on any cell change. Its good practice to avoid INDIRECT whenever possible because of this.
That's why you can make it recalculate by just changing a cell.
Since deleting ranges doesn't change cells, INDIRECT won't recalculate.