At the end of the year 2019, congress passed the SECURE Act. This act does many things relating to retirement accounts, but Section 302 specifically relates to 529 account expansions. These changes seem to explicitly state that student loans are eligible for payments from tax-advantaged 529 accounts.
As it stands currently, I'm paying my existing student loans from a non-tax-advantaged account (i.e. my bank account) and receiving no benefits from it. Could I put this money directly into a 529 a month in advance in order to circumvent having to pay taxes on my income that is devoted to student loan payments?
Example for clarity: I pay $300 a month to student loans. This money is taxed, and put into my debit account before I pay my loan. Could I instead place the $300 pre-tax into a 529 for myself, and pay back the loan from that?
Finally, if I am able to do this, would I be able to retroactively do this for 2019 as of today's date?
(Even if there's no obvious benefit here, my work does still offer a $200 yearly contribution to a 529 account if I open one)
Edit: As relating to state taxes, I live in PA, however I understand that I can make a 529 for any state, despite where I live.