Enable Job instantly after AOAG Role change
Not sure if you can build a "trigger" to capture role changes.

I would probably set up a SQL Server Agent job that runs pretty frequently. Check

SELECT primary_replica
FROM sys.dm_hadr_availability_group_states;


and compare this value to a local table to detect when the primary replica changes.