I'm planning to buy a round trip ticket (USA -> Jamaica -> USA) where I will be staying for about 5 months. However, I may need to return to the states sometime during those 5 months. Will there be any issues regarding booking or immigration?
Your initial round trip USA-Jamaica-USA flight will be a factor in your initial entry and length of stay permitted. Once in the country there are no restrictions prohibiting you from departing earlier.
If you are coming back early, with no plan to return, you can simply call the airline and change your return flight.
If you plan to return to Jamaica to finish out your five month stay, you simply buy a round trip Jamaica-USA-Jamaica. When you make your return flight to Jamaica, the airline may ask to see your original return booking to make sure you will be departing Jamaica in accordance with immigration rules. Jamaica Immigration could in theory also ask for your return flight info.
The airlines are not concerned if you add additional tickets to your itinerary, as long as you are not trying to bypass some restriction they have on fares (which is not the case here).