King James IV of Scotland's alliance with France against England brought him into conflict with the Tudor kings of England.
In April 1513 an envoy from Henry VIII arrived at Stirling Castle to try to persuade James IV to abandon his alliance with France. He refused, and five months later he lost the Battle of Flodden and his life.
What if James IV had abandoned his alliance with France in May of 1513?
Well, James did have people at his court, including obviously Queen Margaret ("ye are to fight a mighty people") and I believe also Andrew Forman, who were counseling against the war.
Several things augured against their advice being taken. First, most particularly, was what the Scottish understood to be several English provocations. The death of Sir Robert Kerr, and the execution of some Scottish pirates by the English, were regarded in Scotland as violations of the Treaty of Perpetual Peace. Now, in truth there was some ambiguity to this, because the actual treaty as it had been originally negotiated actually made explicit that some low-level cross-border violence and the efforts necessary to curb it would not in itself cancel the treaty. James and Henry VII had basically negotiated it with the intent that it be durable, not that it be perfect. Thus Henry VIII could say the treaty had not been violated and was still in effect, and James IV could see it quite differently.
Then you have to add to this the fact that France was Scotland's primary overseas ally. James had tried to court Ferdinand and Isabella in the 1490's but those efforts had run aground. So if Scotland spurned France's requests for help (which were repeated and insistent, and including gifts invoking the language of chivalry from Queen Anne of Brittany to James) then Scotland really would have nowhere else to turn if it was in trouble at some later point. Scotland would be isolated diplomatically, forever.
Also, if you look at the history of the Scottish kings the hundred years before James, few things were as injurious to the support for a Scottish king among his nobles as a reputation for not having sufficient spine against the English. The reasons for this involves the institutional nature of the Scottish monarchy. The king existed as a counterweight against the English, his purpose was resistance against the English, and the reason for the nobility to pay their taxes to him was to have a strong and unified institution existing to defend them from the English. So to them a king permitting the English to act against Scottish interests unimpeded would be a king asking to be replaced, or a good reason for them to not pay their taxes. Now to this point James IV had enjoyed unequaled prestige among his nobles, and was the first King of Scotland to really rule over everything north of the border. He knew not fighting England in the current mix of factors would be fatal to this respect.
Seriously, I would see a James IV who avoided the Flodden campaign most likely dying fighting a revolt by his nobles in 1514 or 1515. In fact, given his preference for the heat of battle, whether courageous or foolhardy (which was noted by the Spanish ambassadors assigned to accompany him during the Perkin Warbeck campaign in 1497) some kind of battlefield death was likely in the cards for him from the beginning.
Finally, I think it's entirely possible Henry maneuvered him into this situation, put James in a place where he would have to go to war, knowing that if James died the next Scottish king would be in his infancy and Margaret would be the likely regent. And of course this is exactly how it went down, except the Scots were hardly obliging to their English regent and she made some...slightly...controversial decisions that ruined any notion of a compliant and subordinate Scotland.
But in any case these are the factors that militate against James sitting out Flodden. Now if you can overcome these, awesome! You might also want to consider the possible alternative that James fights, loses, but survives, Flodden. It would be a horrible blot on his reputation, but renaissance monarchs endured reversals like this all the time (see Francis I at Pavia). And it would still stabilize Scotland until James V could reach his majority.
Hope this is helpful.