At the line "@command_window.index = @menu_index", the method "index=(index)" under the class Window_Selectable is called. Within this method, "update_cursor_rect" is called. And, if you look at Line 102, you'll find "if @index < 0".
You set @index to equal @menu_index, but as SBR said, @menu_index has no value. Thus, @index = nil.
The error is being thrown because...well, what does nil < 0 mean?
Solution: Remove "@command_window.index = @menu_index" from your scene.