I have solved the mystery of why word lookup in my custom dictionary was not working - I could not look up any words shorter than 4 characters. Also marisa-lookup always returned -1 no matter what.
I had to get up close and personal with Marisa, the naughty thing, and put her through a debugger. This showed that all my keys had a carriage-return on the end. Ah ha - Marisa only plays nice with Unix, the hussy! After stripping all my carriage-returns (leaving just newlines) from my index.txt file, Marisa was much happier, and my new dictionary is now fully working.
I have also discovered that the html input files can have multiple <p> elements per <w> element, if you have multiple definitions for the same word, e.g.,
Code:
<w>
<p><a name="a"/><b>a</b>, the indefinite article</p>
<p><a name="a"/><b>a</b>, ä, a dialectic corruption of <i>he</i> or <i>she</i></p>
</w>
On the Kobo, the multiple definitions will be displayed on the same page, with a blank line between them.
The Chambers dictionary I used as my source only has 33,000 definitions (but I like them!), so I am going to look for something a bit more substantial to convert to the Kobo.