How can I know if the customer that made the order is guest or registered customer?
as you said I am using the Mage_Sales_Model_Order object in order to get the information
then:
if($order->getCustomerIsGuest()){
// customer is guest
}else{
$customerid = $order->getCustomer()->getId();
//send the customer id to your external ERP
}
if you just want to know if the customer is guest or not. trigger getCustomerIsGuest()
in Mage_Sales_Model_Order
I believe that can get customer instance of order.