For example, did Spain ever think about how would they fight Vice royalty of New Spain in the 18th century?
At least in the case of Italy, no. This was not a possibility the previous governments (including the Fascist one) had even taken into consideration, and the country was actually stripped of most of its colonies - with the partial exception of Somalia - at the end of WW2. But even there it was the UN which set forth a road-map for the former colonial power to follow; Italy was allowed to keep administrating the former Italian Somaliland as a Trust Territory until it was to be merged with British Somaliland and granted independence... something that happened on the 1st of July, 1960.