1.14+
I tested all of the commands below in version 1.21.11, but they should work in all versions from 1.14 onwards (with small tweaks to angry_at/AngryAt).
Funnily enough, the way to join team pillager is to literally join team pillager!
Run the following commands once:
team add pillager
team join pillager @p
This will create a team called "pillager" that you join.
Now, let's use your snippet to make all other raiders join team pillager. On a repeating command block, run:
team join pillager @e[type=#raiders]
As long as that command is running, any new raider that is spawned will join your team and therefore not attack you, even when attacked.
Happy raiding?
To get the true Arch-Illager experience, villagers and iron golems should abhor you.
You can make iron golems always angry at you by adding this command to your repeating chain:
execute as @e[type=iron_golem] run data modify entity @s angry_at set from entity @p UUID
Making villagers hate you takes a few more commands. Run the following commands once:
data modify storage arqade:hatred Gossip set value {Type:"major_negative",Value:100}
data modify storage arqade:hatred Gossip.Target set from entity @p UUID
Run this command on a slower clock (running it using a repeating command block locks the villager AI):
execute as @e[type=villager] run data modify entity @s Gossips append from storage arqade:hatred Gossip
Now you can only buy things from villagers at the maximum price