lucy24 - 7:00 pm on Jul 25, 2012 (gmt 0)
Once I remove the code all the pages work fine again.
This implies that the original htaccess is unchanged and is sitting wherever it was all along. If it had been overwritten, deleting new material wouldn't bring the old stuff back. So you're looking at two htaccess files, new and old, in different directories.
If the only new material is a with/without www redirect, it should probably go in the middle of the original htaccess: after all existing redirects but before all rewrites.
Now, if this can be pinned down without quoting the entire content of that elusive other file...