yes, you can purchase insurance shortly before you cruise, but i wouldn't recommend it. It won't cover a pre-existing condition then. You must book between seven and fourteen days with most companies in order to get the pre-existing conditions coverage.
For instance, I found out about two months before we were to go on our cruise that my mother had cancer, and the outlook was not good. I checked around at that time, and I couldn't find any insurance that would cover us if we needed to cancel or interrupt or trip if we went.
With a lot of friends and Hospice help, we were able to go after all, because my Mom didn't want us to cancel. She knew we paid a lot for airfare, cruise and so on. We decided to go ahead and go, but had I purchased the insurance at the time of booking my trip, I could have rescheduled for another time and been refunded the money.