Given the symptoms you provided (pain under right ribcage after shoulder surgery, which increases when breathing deep, laughing or sneezing), you might be experiencing pleurisy. Pleurisy is an inflammation of the pleura, which is a serous membrane surrounding the lungs. One of its layers is attached to the inner side of the ribs and the other layer is attached to the outer surface of the lungs.
In case of inflammation, fluids might be produced in the very small space between the layers, thus reducing the inflation of the lungs, and making the breathing more difficult. If there is not much fluids, then the inflamed layers might rub against each other causing the main symptom of pleurisy, which is the pleuritic chest pain. This pain is usually increased when deep breathing, coughing or sneezing.
In most cases, pleurisy is caused by bacteria or viruses. But in certain cases, the inflammation might spread from other organs in the vicinity which were inflamed in the first place. This might be the situation with your shoulder which might simply be inflamed due to the surgery.
However, you might want to visit your family doctor for a physical examination. An x-ray or CT scan might be recommended in order to visualize any changes in the chest. This would be a good way to prevent potential development of more serious conditions like pneumonia, in case the pleurisy was really caused by bacteria or viruses.