The scholars sign a two-year enlistment and sign an memorandum of understanding that if offered an appointment they will accept. Also, at the end of the time in school they get a general discharge (honorable) at the convenience of the government. This means they are free and clear of the enlistment in the summer period before Day One. That's the legal aspect.
Now the practical. First, the scholars don't go to boot camp, but to a three week indoctrination. So, let's say a scholar finishes the year, gets offered an appointment. If they wait until the day after the discharge papers are released, then there is no legal way to be ordered to CGA. Do they have to pay back the scholarship? No, because they completed their enlistment in an honorable manner. Also, the pay they receive is pay, not scholarship, so that can't be recalled without a lawsuit.
Ok, so what happens if they are kept on the enlistment contract up until reporting in? Then they are released from the contract to become a cadet. At any time in the first two years a cadet can withdraw and not have to pay back for the schooling they've received. They do not have a commitment until they start their junior year.
What if the Coast Guard wants to keep them? The Coast Guard can't put them on a ship, because they haven't done basic training. By the time scholar is ready to go to a ship, they'll just a few months to go on the enlistment contract...not practical for the ship.
In summary, if a scholar completes the year and gets offered an appointment but tells admissions that they will decline, there is generally no repercussions. The enlistment contract is terminated as usual, and the scholar is free and clear. This frees up a slot for admissions to give to a student on the wait list, and you don't get a student who's likely to drop out in the first two weeks of swab summer. Mind you, this is if the student does everything right. If there is any kind of legal misconduct, all bets are off! Then in the worse case scenario they are kept on active duty while the legal proceedings occur. I've never seen it, but that doesn't mean it can't happen.