It is mandatory for properties to have a habitation license if you are planning to live in or rent out the property. In Lisbon, it is very common that properties are converted from retail to habitation due to many old buildings in the centre having shops and offices within them, it is important to check that this alteration is registered and approved by the municipality before the purchase.
Regardless of the kind of property you're purchasing, a lawyer is always a must when buying or selling, as there are many documents that need to be checked and timings that need to be fulfilled within a specific schedule.
In other words, you need someone that truly knows the market they are working on, so they can help you to make the whole process as fast and smooth as possible