If the company/person could provide a guarantee that the company was in fact dormant then there would be no risk involved in doing this. I know many people who have taken this route and have had no problems, however you can get a VAT number in less than 48 hours in Cyprus (sometimes the same day) if you provide the correct documentation.
The only point in buying a company with a VAT number would be if you had a deal that COULD NOT wait, generally this isn't the case and it is very easy to register for a new VAT number. This decision really depends on your circumstances, hope this helps!