Dynamic Notification Profile - Alarm Pipeline Notification Block

If i use switch blocks, this logic will have to be repeated for each notification profile, which would be a lot more work to maintain. Each region group contains approx 3/4 remote gateway which need independent rosters. Also the pipeline work area does not like getting stretched passed a normal screen resolution, so it would not be possible for me to replicate this logic 5 times in a pipeline.
Which is why i want to script the notification profile in for less upkeep.