Although that does work nicely in the scenario I presented, that won't work in for my real-life case: there are other inserts into identity tables earlier in the procedure.
I should probably also have mentioned that Parent + Group + Value is unique.
I solved it. Cursors! er, make that "Curses!" 😛
Since the code will be called on average once a month, and involves roughly a dozen rows, I'm not especially bothered by a cursor solution.
Thanks for the help.