How can I compare the customer’s billing address with the address from VIES (or other national VAT service)?

In short, you can’t. Firstly, services like VIES contain the registered business address of the holder of the VAT number; this does not have to match either their trading address or the billing address of the payment they are using at your WooCommerce checkout. In many cases it will be the address of their company’s accountant, which can legitimately be the address of a different business entirely. Secondly, the data is not returned by VIES in any structured form; it is simply returned as one long sequence of text data. That is to say, VIES won’t tell you which part is the street address, which is the town, county/state, etc. Even individual national VAT authorities within the EU do not appear to enforce any consistent standard for which parts of an address they require to be included. Perhaps somebody could create an AI-like tool to generate a statistical probability to say whether any address you obtain at the WooCommerce checkout is truly the same address as what is in VIES; but this would be a large undertaking and it would be impossible in advance to predict how many false positive matches and false negative failures-to-match you would obtain from doing so.
In any case, if your aim is to prevent fraud by requiring an advanced address match, then this is also a hopeless task, since VIES and other VAT databases are public. Anyone who can look up a VAT number can also obtain the registered business address for that VAT number, and supply it. It can never be a demonstration that the person entering details at the checkout had any secret knowledge that only the true business owner would be able to supply.

Posted in: WooCommerce European (EU/UK/Norway/Switzerland) VAT Compliance