You could probably do alot just by killing Santa Anna early in his career. Maybe you could avoid the murder of Vincente Guerrero. Try to get someone into the Zocalo who is competent and makes sure the Mexican army is well organized and staffed, and keep him there.
Better yet: have Iturbide die right after independence. Guerrero gets to be the first president of Mexico, and becomes the Washington of his country, so to speak. Without the whole monarchy debacle, I don't see things going wrong between Guerrero and Guadalupe Victoria. They can probably get the country well in order, and may be able to prevent the secession of peripheral regions in Meso-America. This would demand that they grant a lot of local autonomy, which is a good thing-- because without it, you won't keep a very large pre-industrial country together anyway. Such a policy might also prevent later OTL problems with local uprisings (Yucatan, Rio Bravo, etc.)
...and yes, as you say: it would in all likelihood also prevent Texan independence, which was a direct response to centralising legislation introduced in Mexico in (I seem to recall) 1835.
Of course, even if we go with the above scenario, and assume that it yields a stable, propering Mexico, the far north is still going to be a rather undeveloped and under-populated region. And Americans will still be moving west, in an area where national borders mostly exist in theory alone. A Texan attempt at independence may just come later than in OTL, just as the USA is pushing Mexico to sell California (as it did in OTL). This stronger Mexico will be even less inclined to agree to such proposals. As a result, we may see a USA-backed Texan secession, co-inciding with an American attempt to seize California-- and roughly at the same time that the Mexican-American War occurred in OTL.
A stronger, larger, richer, better prepared Mexico might just succeed in kicking out the invaders, thus proving its mettle to the world. I do suspect if demographics in texas go roughly as in OTL, a rump-Texas will be recognised as independent by Mexico... if only to keep those damned unruly insurgents out of the country! Such a Texas would be forced into a more definitive treaty than in OTL. That is, no more excessive claims: Texas gets its independence, within defined borders, and has to accept those borders for good. After giving the USA a beating, Mexico can probably get Britain and/or France to act as guarantors for the final treaty.