Well yeah it's all about permissions and owners - the good news is that I have managed to get it back to its original state, and have learned some more unix along the way, so I will have another go tomorrow.
Among the things I found were that the unix commands on this thread didn't change the owner and group of the files to root wheel - instead the owner was stuck as my user name no matter what I did. Using a knowledge base article (
http://docs.info.apple.com/article.html?artnum=106290) I enabled the "root" user and then actually logged in as root to make these changes. Then another thing was that the Tiger files I'd copied had drwxrwxr-x@ as their permissions (by doing ls -l in terminal). All the other files in the System/Library/Extensions folder all had drwxrwxr-x (no "@"). I haven't been able to find out what the "@" at the end means, as Google filters it out, but I couldn't get rid of it either. Then on rebooting I'd get a kernel panic, which I think you are right about deleting the extension cache to fix (as on this page
http://kb.ciprico.com/lore/article.php?id=194). Anyway, with all those going wrong, I started the iMac in target disk mode and used my Powerbook to copy the Leopard files back. Then rebooted the iMac (no kernel panic) and logged on as root; then changed the owner/permissions (the @ sign disappeared - phew). So I'm back to square 1! I realise this isn't the place for a course in unix/terminal for beginners, but if there were clear instructions about things such as logging in as root and so on, I might have got here a bit quicker! Anyway, armed with my new-found dangerous (and very piecemeal) knowledge, I'll have another go tomorrow and see if I can beat this thing, and get the trusty old imac to sleep again...
If there are more efficient ways of doing this all directly from the terminal (without logging in as root and so on, I'd be really grateful for any help!)