as long as you have it packed in a luggage case I see no problem with this. When I worked on Holland America ships I owned a bicycle and I carried it right off the gangway all the time. I was not the only one.
This was before they had x-ray security, etc, but they deal with wheel chairs and motorized scooters all the time, so I really do not foresee a problem.
I think it is a great idea.
By the way - if you love biking many smaller, expeditionary cruise lines have biking tours in several cities, and some ships even carry bikes on the ships (especially river boats). In Europe a bicycle can be one of the best ways to see a port stop, especially if it is not a major city.