I am looking into this prospect as well, and have done since I returned from living in Belgium from 2006 - 2008. After three Caminos, and at least two round trips to Spain a year, plus all the ancillary ground support costs, I figured out that I can rent a furnished flat in Santiago de Compostela for almost the same amount of money. Then I could be a full-time volunteer...
The visa thing is relatively simple. What you want is the Type "D" Schengen visa, or Spain's equivalent. That gives you the right to reside in Spain, buy property, a car, etc., but not to work. The Schengen version of the Type D visa should be useable in any Schengen country, regardless of where is was issued. But I am unclear on this point.
The visa is good for up to five years (in Spain), and renews annually. The visa term is only four years in some other Euro countries but renewable annually. You just visit your local ayuntamiento, or maybe the Guardia Civil (not clear which), annually to update your information, pay another fee, and have your five-year visa annotated / revalidated for another year.
You apply for the visa in your home country by checking for the nearest Spanish consulate or the embassy, depending on where you live. There are forms (in Spanish of course), a physical examination requirement, and a criminal background check required. The latter item can be requested online from the FBI. It is merely a check of the National Crime Information Center (NCIC) system (CPIC in Canada), the same system the police "run" your license against whenever you are pulled over for a traffic stop.
The advantage to having legal TEMPORARY residence is that, under bilateral treaties between the US and most every country in the world, you are NOT considered a resident for local tax purposes. Thus, while you still (and always and ever) must pay US income taxes no matter where your income originates and anywhere on the planet, you do not have to pay Spanish, French, Belgian, German, Italian, etc. income taxes. If you own real estate, you DO have to pay those taxes. There may be other local taxes you must pay as well since you ARE living there. The bilateral treaties only affect federal level income taxes.
Once you become a PERMANENT RESIDENT of any European state, under the bilateral treaties, you are liable to pay BOTH US federal income taxes, AND the national income taxes where you live. Under the treaties the amount you ow the Euro state is offset or reduced by the amount you paid to Washington. However, at the end of the day, you still end up paying income taxes at European rates. Ouch!
I hope this helps.