[CoroFrame][NFC] Reduce insertSpills size through a helper function (#177129)
This function can be pretty difficult to follow due to its size and how
much work it does. This commit moves a lambda capturing a lot of state
into a self-contained function.
It will allow subsequent patches to simplify code and delete variables.