Hello
$order->history->history_data
Don't hesitate to take a look at the HikaShop code and plugins code in order to see how they are dealing with order status modification.
You can find for example a lot of useful code in the HikaShop helper core file ; in the hikashopPaymentPlugin class definition.
The invoice number is only generated by the save function when the status of the order changes from the created order status to one of the invoice order statuses as you can configure in the menu System>Order statuses. So you might actually have an issue with your order statuses, or you didn't set an invoice status in the order_status attribute of your $order object.
Regards,