It's because my shop unlocks script overwrites on_category_ok and checks the index of the command window to see whether to activate the buy or sell windows. In the sell only script index 0 is "sell" but my script thinks it's "buy" which is why the scripts were causing a crash.
It's an easy fix; change lines 571 and 594 (in the shop unlocks script) to:
if @command_window.current_symbol == :buy
and lines 574 and 597 to:
elsif @command_window.current_symbol == :sell
That's the original post updated with the fix.
Fixed! I've updated the OP, but to fix it without having to redownload:
change line 402 to:
@goods.push([1, i, 0, 0, false]) if include == true && !@goods.include?([1, i, 0, 0, false])
and line 423 to:
@goods.push([2, i, 0, 0, false]) if include == true && !@goods.include?([2, i, 0, 0, false])
That should fix the issue. Sorry about that!
Edit: My client has requested that I not make his script commissions public until the release of his project, so I will no longer be providing or supporting this script here. See the OP for details.