Well, according to that code snippet, it seems to be hard-coded at 80 regardless of merchant type, so putting 255 items on an NPC may not even work; however, if you want to remove that limitation you can try the below Perl file that auto-generates merchant entries to a .SQL file using the first 255 items (1001-1255).
Code:
sub A {
open $file, ">test.sql";
my $n = 1;
for ($i = 1001; $i < 1256; $i++) {
say $file "INSERT INTO `merchantlist` VALUES ('1', '$n', '$i', '-1100', '0', '0', '65535', '100');";
$n++;
}
close $file;
}
A();