I wouldn't recommend it. If the ship leaves at 5:00, they'll start boarding about 12:00 and want everybody on board by 4-4:30. After you finish your bike tour (4:00), you'll probably need to pick up your luggage from your hotel and get down to the dock. Traffic in Barcelona can be very heavy and you will be trying to get to the dock in rush hour!!! You don't want to be running up to the ship at the last minute, or worse, watch the ship pull out of port with-out you.
Perhaps you can fly into Barcelona ahead of time so you can spend a day with the bike tour and not be rushed to get to the ship, or check if there are any bike shore excursions at any of the other ports of calls.
Have a great cruise!