Later political career
After he stepped down he continued to be a member of the liberal federalist party, but Gómez Pedraza and his colleague Rodriguez Puebla were among those liberals who opposed President Gómez Farías' efforts to assimilate Mexico's Indigenous Communities. When Anastasio Bustamante returned to the presidency under the Centralist Republic of Mexico, he at one point pursued a moderate course to the point where Gomez Pedraza ended up as one of his ministers in December 1838, but Gómez Pedraza resigned after only three days due to disagreements. He was however able to serve as Minister of Relations under Santa Anna in 1841, during a time when federalists hoped that the newly elected constitutional congress would reestablish the federalist constitution. Gómez Pedraza would actually be a part of that congress until it was dissolved by President Nicolás Bravo.
After the fall of Santa Anna in 1844, Gómez Pedraza was a member of the grand jury charged with trying Santa Anna after his capture, but the dictator was amnestied. Later as part of the senate he helped pursue President José Joaquín de Herrera's aim of seeking a diplomatic solution to the Texas problem, hoping to recognize its independence, while gaining concessions that would allow Mexico an honorable end to the decade long conflict, but this was interrupted by a coup led by Mariano Paredes who was part of a faction of hardliners who preferred war.
During the subsequent Mexican-American War he was a part of the council of state, and he tried to restrain President Valentín Gómez Farías' efforts to nationalize church lands in the middle of the war. At the end of the war, as the Mexican government was based in Queretaro, Gómez Pedraza took part in the confidential consultory commissions, established by president Pedro María de Anaya. Gómez Pedraza himself belonging to the commission of foreign relations.
After the treaty of peace was established he returned to the capital and was a candidate for the presidential elections of 1850 but lost to Mariano Arista. The government of President José Joaquín de Herrera commissioned him to conclude a treaty with Robert P. Letcher regarding communications across the Isthmus of Tehuantepec.