So this is 100% a minecraft data pack thing... (programming languages are not similar at all) I have a function to detect if I am in a portal
execute at @a if block ~ ~ ~ blue_stained_glass_pane run say inPortal
So I was wondering if it would be possible to somehow either change this function into a predicate
Or if there is a way to change this into a seperate function and write
execute as @a if function???:inportal run...
A comment on any other ways to detect if they are in the portal would be cool too.

Setting into a predicate is not very practical and will just cause more issues! Doing it this way is simpler and will work fine for you!