For the matching-&-deleting, provide some sample data please (say, three item=data lines).
So far, it sounds like a task for a loop of $hfind(table,wildstring,N,w).data to wildmatch the data (whole data line) of all items in question and a further loop of $deltok(line,$wildtok(line,wildstring,N)) on each of these data lines (to find and remove matching tokens/words from the data)...
mIRC won't delete "empty" items from a hash table automatically, but adding a check - some "if ($hget(table,item) == $null)" - won't add much overhead to that a script.

As a general design idea and to avaid that error in general, why not check the total data length every time you add a fresh chunk of data to an item; and drop some older data after a certain limit had been reached (e.g. cut off some of the first words/tokens before adding new data at the end)?