Yes, you can!! We did the 7-day Med/12-day Trans b2b last Sept. Flew into Barcelona two days in advance to see the city, but saved La Rambla walk for the between day. Got off the Magic at about 8:30, caught the shuttle bus (fee, got round-trip ticket because it is a long walk to downtown) to the Chris Columbus statue and walked La Rambla for about six hours...lots to see and neat coffee shops. We did most of the Gaudi stuff, Old Town and Picasso Museum before on the first leg, but one of these might be doable for you if you take the subway or a cab during the 'tween day. We came back to the ship around 2:30, checked in with our paperwork (remember to take it with you as you leave the ship after the first leg) just like you were starting a new cruise. We got a boarding number that was already called/underway so we walked right on.
You will get a letter the night before this 'tween day on your bed from
DCL telling you the options for the next day. Also, your dinner staff will ask you if you liked your dining arrangements/seating mates...they will change to your preference for the second leg. Last thing is your stateroom. If you can keep the same one (we had 6018, which we loved), do so. Then you don't have to pack/repack anything. However, if you do change, pack up the night before, tell your room steward and the suitcases will be moved to the new room the next morning while you check out/in...you have to leave the ship, even if only to hit the terminal and come back on when allowed.
Last tip: Watch your purse/wallet. I got pickpocketed in a store across from Park Guell...not much, just day spending money. I had a money belt around my middle with serious cash, passports, etc. However, they train even kids in this art to the point that Barcelona is the pickpocket capital of Europe. Check out
YouTube for videos on this skill.
Other than that we had a great time. The Med cruise was a grind, but we saw/experienced a lot (7:30-5 excursions). Our stop in Monte Carlo was scrubbed because the tender boats could not handle the rough water...docked the next day in Marseilles instead. We relaxed on the Med cruise with the mouse...7th one, third without kids. You'll have a great time...enjoy. Check out Rick Steves books on what to see/do in the Med. They were invaluable to us.