If seller's basis before the sale is $20,000 and half the shares were sold for $30,000, then sales price would be $30,000 and basis would be $10,000 ( 50% of $20,000).
Seller's basis schedule would show a reduction in basis of $10,000 related to the shares sold. $10,000 of basis would remain.
Seller would show sale of S corp stock on Schedule D of seller's personal tax return.
Buyer would have an increase on their S corp basis schedule of $30,000.