Apologies, the original patch is incorrect because define-abbrev requires passing :count as a keyword argument unlike the obsolete calling convention. Attached is a new patch, which unfortunately does not preserve the old abbrev file writing format. However, any recent version of Emacs will be able to accept this format for define-abbrev, and the previously written abbrev file format is documented as obsolete, so now is as good a time as any.