Presumably, driving the last European power that was
What would have been the strategic purpose for the invasion then? What would have been considered success?
Presumably, driving the last European power that was still contesting the independence of its former colonies out of the hemisphere; the Spanish had attacked Mexico from Cuba as recently as July, 1829.
A Spanish squadron, carrying some 3,000 troops under Isidro Barradas landed 60 miles from Tampico; Barradas marched, while the ships returned to Cuba for reinforcements. The Spanish were met at Tampico by some 4,000 Mexican troops under (here's a name) Gen. Antonio Lopez de Santa Anna, who attacked Sept. 10. The Spanish surrendered Sept. 11; they had suffered more than 900 casualties (including to disease) and only 1,800 returned to Cuba. Mexican casualties were about 300 dead and wounded; unknown to disease.
The Mexicans planned to infiltrate raiding forces into Cuba in retaliation, but there was a coup in December and that fell by the wayside.
Given the fairly recent Spanish threat, and the - generally - good relations between the US and the Latin American republics at this point (A Porter was a commodore in the Mexican Navy during the Spanish war, for example), so there is the possibility of a "Pan-American" war against Spain, which would have some interesting ripples...
Jackson as president, Lewis Cass (presumably) as Secretary of War, Levi Woodbury (presumably) as Secretary of the Navy, Livingston or McLane as secretary of state and treasury ... given the upheaval of the Petticoat Affair, Jackson's second cabinet was actually pretty impressive.
As far as US naval strength goes, personnel strength varied from 5,000 to 8,000 officers and men in 1833-39; at the height of the 1846-48 war, personnel numbers were 11,000, so it's not a huge stretch - and those 11,000 manned the squadrons that covered both Scott's landing and blockaded the Mexican Pacific Coast, so for the purposes of getting an expeditionary force from (presumably) Pensacola to Havana, it's a reasonably-sized force.
Success, presumably, is a free Republic of Cuba - Puerto Rico is an interesting question; federating the two is tough with Hispaniola (Haiti and DR) in the middle, but PR is pretty small for a republic, even today.
Politically, independence sidesteps the "slave or free state" issue pretty neatly; the question is whether there would be enough Cuban support for a rebellion as early as the 1830s.
But if the Spanish are in the middle of what amounts to a civil war of their own, and the US can avoid any internal conflict over admission of Cuba and/or Puerto Rico, it is certainly possible in terms of the correlation of forces in the Western Hemisphere.
Best,