1. It's time that Linc Davis had the Apple Discussions Forum named after him. 🙂 Thanks, as ever! It worked beautifully.
2. A warning to dummies like me: Terminal gives non-Unix people so little feedback, that I failed properly to think/notice when I was asked for my password a second time. The first half of Linc's above long command took a while (say 15 mins? maybe longer?); then I got another password prompt which I ignored, waiting for hours for the process to finish. When I woke up to my idiocy and entered the password again, the second half of the routine took another 15+ mins. FYI I think the Terminal window was titled "chflags" or "chown" for the first half and "chmod" for the second. I don't remember getting three window titles but perhaps I didn't notice. (There are three commands in Linc's routine, separated by semi-colons.)
Some background for people having other trouble:
(a) I think I have reached the end of my nightmarish weeks with Yosemite! I experienced a lot of buggy behaviour throughout my Mac (lots of force-quitting, slow or non-existent waking, and originally even some hung logging-in), and while different solutions improved things, no solution got rid of them all. I remember one that helped quite a bit, namely following advice I found elsewhere about trashing wifi settings. (This surprised me because I didn't think that was my problem.)
(b) In the end, after hoping not to have to, I did a clean install, which did improve my Mac's behaviour a lot. Being careful, I did not import my Apps - I just redownloaded and installed them. I only carefully moved over my documents etc., and also then imported my mailboxes into my email app - i.e. I did not import my user Library folder. I do recommend this approach - but stupidly I messed up my settings when using Carbon Copy Cloner for this purpose, thereby putting things in the wrong place and locking myself out of a lot of my folders. A permissions mess!
(c) I then tried to use the Batchmod app to try to fix this, but this was dumb of me, and ultimately did a better job just using the Finder (Get Info). This, I thought, had fixed it, but in reality I had made things worse, because my home directory required authentication with every write. This meant, for example, that I couldn't install Google Drive or open iTunes.
(d) Next I repeatedly tried the passwordreset routine (in Recovery Mode) as described by the Original Poster of this thread. Like the OP, this did not fix my problem. Even worse, I became partially locked out of my major Filemaker Pro database! I had permission to do some things but not others, yet it was a master password! This might have been caused by the reset ACLs command in the resetpassword utility, or it might have been that I followed the advice of a website to first run a Terminal command clearing all ACLs.
(e) Then I found this thread! Hallelujah.