Madrid-Santiago (I guess you mean Santiago de Composella?): not a big choice here, either flight (for instance RyanAir) or trains (afternoon Talgo or overnight), for both trains the earlier you purchase your ticket the better fare you get ('WEB' discount can get you tickets for as low as 20.1 EUR)
Santiago de Composella-Porto: there is no direct trains to Portugal, the closest station from where there are - Vigo (
http://www.cp.pt/cp/displayPage.do?vgnextoid=678439a3f64de110VgnVCM1000007b01a8c0RCRD), so you will need to catch local train Santiago de Composella-Vigo (from 7.3 EUR to 8.7 EUR) and then change for the one till Porto.
Porto-Lisbon-Vila Real de Santo António: you might avoid more expensive Alfa Pendular trains (marked as AP), but use InterCity trains, they almost as fast, but cheaper. For Portugal domestic route same rule as in Spain applies - earlier purchase of the ticket can get you a discount (up to 25%) -
www.cp.ptVila Real de Santo António-Ayamonte-Sevilla: either bus or get the ferry on your own and then continue by Spanish domestic transport. Here you can find more info -
http://thomasallen.home.sapo.pt/travel/001.htmSeville-Valencia and
Valencia-Barcelona: same advice as earlier for Spanish domestic train travel, earlier purchase gives you better fare. If not - consider bus (for instance
www.alsa.es)
Barcelona-Paris: couple options, cheapest is to fly (RyanAir, Easyjet etc.), also you can get by local train till Figueres (from 9.8 EUR) and catch there TGV train till Paris. Or get of train a bit further at French-Spanish border PortBou/Cerbere. From there you already can get domestic French train till Paris (rail tickets Cerbere-Paris can be as low as 30 EUR)
Paris-Munich: already discussed, but reversed way.
Munich-Prague: either purchase in advance discounted ticket from DB website (from 29 EUR,
http://reiseauskunft.bahn.de/bin/query.exe/en?newrequest=yes&protocol=http:&) or get Bavaria-Bohemia ticket (24 EUR for one person or 34 EUR for up to 5 passengers), use it till Plzen and then just purchase Czech domestic ticket (147 CZK)
Prague-Budapest: best choice here is to purchase in advance discounted tickets for daytime trains (
https://www.cd.cz/eshop/international/search_int.aspx?tt=4 , from 19 EUR).
Budapest-Vienna: already discussed previously.
Vienna-Bern/Geneva: cheapest thing is to purchase in advance discounted international ticket (
https://ticket.oebb.at/bin/frame_ticket.pl?ticket=jticket.pl&LANG=EN), seats from 39 EUR.
Bern/Geneva-Milan: here we have two major option: a) "hunt" for discounted international tickets (for instance, purchased in advance Geneve-Milano can be as low as 25 CHF -
https://www.sbb.ch/mct/wi/shop/b2c/pipSchritt_1.do); b) use domestic Swiss train till the border + domestic Italian from the border till Milan, as result to avoid expensive international tariff.
And we already discussed trips within Italy previously.