Just how ‘expensive’ is this function?

rule of thumb, never do anything that results in DB write from the front end. Even better if you can create an admin page in which the operation is triggered (even if it just starts an AJAx based process).

Your problem here is with hooking on an inappropriate hook. You hooked on init which means that for each request the code to change all your posts is being run. Since this is a heavy operation it overloaded you DB and therefor your server. I am not sure why cron was singled out here.

As an additional note, your save handler is not great, you should make sure you are handling the post type you want and not revisions or auto saves.