James IV was one of the more outstanding and gifted Stuarts , along with James I and II, and not as confrontational with the nobility as the latter two - one of whom ended up murdered in an elite plot and the other of whom faced civil war and murdered the 'over-mighty subject' Earl William of Douglas in person in an effective counter-coup. Despite starting off at the age of 15 as the puppet of a junta of rebel lords who put hi on the throne in place of his centralizing and unpopular father James III after defeating the latter (who was then conveniently killed by an assassin), James IV emerged as a strong and successful political leader and a competent general, brought the nobility and Church under control, and seized the Lordship of the Isles (ie rule of the W Highlands and Hebrides) from the Macdonalds by buying out and deporting its head , John Macdonald. He then made most of the local lairds and clan chiefs do homage to him as the new Lord and personally toured the region several times, the first king to do this since Robert I Bruce, though some rebellions continued (eg on Lewis) and the first naval tour as far as the Orkneys, with cannons on board his ships, to round up dissident nobles was not undertaken until 1541, by his son James V. if J IV had reigned longer he could well have done that himself - and he would have exercised closer control of all his outlying regions than was possible during his son's long regency (1513-28).
With his illegitimate son as Archbishop of St Andrews and his ally James Beaton in Glasgow James would have controlled the Church as well; he was a committed enthusiast for literary culture and the arts and a patron of education, but there is no hint of any 'advanced' theological views on Church reform (though he was too early for the Reformation anyway) and his religious interest in austere Christian monastic movements like the Observantine friars went along with close central control of Church appointments. He is likely to have stayed within the parameters of catholicism, like his son James V; but he had a genuine idealism for Christian unity and tried to head off the Holy League turning on Venice in 1510-12 and tried to steer Pope Julius into using his skills and energy to construct a Crusading coalition to take on the Ottomans instead. This was ignored and he dutifully signed up to ally with France as the Pope wanted, partly due to naval clashes with France's foe England; but he would have taken an interest in the next schemes for European Christian unity, a Franco-Imperial/ Spanish-English rapprochement, and a Crusade launched by Wolsey in 1518. If James had been as busy on behalf of this as he was in favour of peace in 1510-12, then Wolsey would not have seemed its sole main cheerleader and it would have seemed less of an English scheme; could it have stood a better chance of (temporary) success ?
Probably the enmity of Charles V and Francis I and the jealousy of Henry VIII towards anyone who seemed to be eclipsing his own prestige would have wrecked it ; but I can see a bored James, who has settled Scotland and needs to perform on a wider stage, offering himself to Pope Leo X to lead a Crusade. In view of lack of contemporary commitment to this by other rulers except as 'spin' to show off their credentials, at the most he would have been able to go off with a contingent of troops under Papal blessing (and Venetian ships?) to aid the defence of Rhodes against the Turks in 1522 - any help from other kings is unlikely, with Francis normally a Turkish ally. Or could he have offered to help defend Hungary from attack in 1526 and ended up 'dead or disappeared' at Mohacs instead of Flodden, as the 'Last Crusader'? if so,James V would succeed aged 14 not 1 and there would be no need for a regency.
Some Stewarts who did not get killed lasted until a much more advanced age than Plantagenets or Tudors - Robert II died at 74, Robert III at around 69, and the latter's brother the Duke of Albany at c. 80. Given the violence of Scots politics, James IV was unlikely to have survived to old age; but had he been alive, available and still physically fit he could have been called upon to help the foes of Henry VIII, his brother-in-law but a man deeply distrustful of his kin and liable to paranoia, overthrow him in the name of the Church and put Mary Tudor on the throne in the mid-1530s.Normally his ally France was less antagonistic to Henry than was the Empire; but the chivalrous and devout James could have been prevailed upon to help his niece Mary and so ended up as a dangerous enemy to Henry. Either we get a later 'Flodden' scenario for the mid-1530s, with Norfolk's son the next Duke (Anne Boleyn's uncle) as the English victor who gets the dukedom back, or we have James and dissident nobles in N England allying and a possibility of them winning - or James aiding the 'Pilgrimage of Grace' in 1536. Or does Henry use anti-centralising Scots nobles, eg the resistance to central control by the NW clans, to start a successful rebellion in Scotland once is clear that James is backing Catherine of Aragon?
If James isn't killed, his wife Margaret Tudor does not remarry to the earl of Angus, so we have no birth of Margaret Douglas in 1515 (and any child of Margaret T's is not born in England like MD was, so all MD's chiidren are covered by Henry VIII's exclusion of foreign-born relatives from the English throne in his will). If MD is not born there is no marriage of her, an English resident in the 1540s, to her uncle Henry VIII's Scots ally the earl of Lennox; there is no birth of her OTL son Lord Darnley, so he does not get to marry Mary Stuart and the whole tenor of Scots politics in the 1560s-70s is far different. Presumably Margaret Tudor has other sons after James V by James IV and/or daughters; these are now fully royal Stuarts and so James IV or James V marries them off to overseas royals or Scots nobles. A daughter might marry Lennox and her sons be available to marry Mary Stuart after 1560, but they would not be as rash, stupid, drunk and suggestible as Darnley so they might well stabilise Mary's reign. A younger son of James IV would be the probable Regent if James V died in 1542 as in OTL, so there would be less feuding in the regency then; and if James IV leaves younger sons with their own children to enter Scots politics in the mid-C16th this complicates matters further. Arguably, even if James IV dies in the 1520s or 1530s and then James V dies in 1542, there is more stability later as Mary Stuart has adult male uncles or cousins to call on for help. And if these descendants of Henry VII are around in the later C16th, could one of them be a rival candidate to succeed Elizabeth I in 1603 or try to take Scotland over after James VI has left for England? Would this wily politician have had to buy them off as his viceroys in Scotland, or deport them to London as dangerous?
(I have written on the Stuarts vs Lords of the Isles struggles myself at length;T M Venning, 'Lords of the Isles', pub Amberley 2015)