If the STAR smog station which inspected your vehicle is a Test & Repair smog station, as opposed to a Test Only smog station, yes they can test your car and also repair it. Both STAR and non-STAR smog test & repair and smog test only stations exist. Just ask the station which type they are. Learn about the
Different Types of California Smog Stations.
As far as the repair cost and the station offering to buy your vehicle... it's not uncommon for smog stations and auto repair facilities in general to be involved with purchasing and selling vehicles. Unless the business is buying the vehicle for personal use, they need to have a used car dealer license. Aside for that, and only to ensure there is no underlying motive to quote you a higher than actual repair cost for your vehicle's smog failure, we'd recommend you get a 2nd opinion regarding what is required to be repaired in order to get your vehicle to pass the smog check.