Hi Neils, sorry, but you should have had a reply before this... the only thing I can think of that might help here is to edit the php.ini file and increase the max_execution_time from 240 to 480. This may or may not have any impact, never tried it myself. Empty the moodlecache first though.
As a general rule, I do not delete any recent courses. Never know, but this does not mean we have a hoarder mentality. Things happen and in education, what goes around comes around and if you stand still long enough, they will catch up to you, what's old is new again, and any number of platitudes and other justifications... What I am doing is to reset courses, stripping out anything other than the materials of the course, then archive it to its year of use. This year, the last archive is 2012, the 2011 archive is to be deleted, Courses that qualify for archiving are courses where the key instructor has left and no-one indicates they will be using the course, or courses that instructors inform me that they are no longer going to use a particular course. As a further safeguard, instructors already have a reset backup of a course they teach in their personal storage, and I imagine that there are some courses that date back to v1.8 or so.
Every year, I usually archive only about 5 or 6 courses, and we have ongoing backups of course, so the archive is not new. I am not sure how far back out backups go now, some materials were damaged during recent storms, but we should have stored backups on retrievable media going back to when I first started with Moodle, in 2008.