The only way I could see the Republic of Sonora being annexed is if William Walker had a well supplied, competent army that could defeat the inevitable Mexican attempt at suppressing the filibuster. Only if Sonora is able to hold it's independence would Congress ever admit it, and given the timing of it (1854), its annexation would be extremely controversial because of the possibility of extending slavery.
But let's say it happens. If the Republic of Sonora is a fact (it has functioning army and government that can maintain its independence), then I think Mexico will grudgingly comes to terms with the US and renounce its claims in return for money. If it couldn't defeat the US in 1846-48, I don't see them thinking they could win this time. If Mexico does choose to fight (for emotional reasons more than anything else), they are defeated once more. Mexico gives up its claims, gets some cash in return. In either case, the annexation probably becomes part of the treaty that would include the lands of the Gadsen Purchase.
The United States was not going to annex all of Mexico. There were too many concerns about the ability to turn Spanish speaking Mexicans into English speaking Americans, concerns about Mexico's Catholicism, and a general dislike of Latin American culture in general. Plus there is the slavery issue - northern states were concerned that slavery would be re-established there. It's possible that besides the territory of the Republic of Sonora and the Gadsen Purchase, that the US might annex additional land just south of the Rio Grande that is mainly unpopulated and potentially easy to fill with its own settlers. It's probably unlikely though, as it serves no strategic interest.
Most likely, the Republic of Sonora is eventually divided into two states - one for Baja California, and the other for Sonora.
This event likely ruins US-Mexican relations and creates a lot of animosity (even more than IOTL). It establishes a pattern of US opportunism to take any Mexican land anytime it wants under the flimsiest of circumstances. At least the Texan Rebellion and Mexican War was understandable, but the filibuster invasion of William Walker is in no way anything other than malign and predatory.
It's entirely possible that the US might have been able to buy both Baja California and Sonora at the same time as the Gadsen Purchase. Perhaps not likely, but it is within the realm of possibility. In that case, it might be possible for the US to gain possession in a manner not as offensive.