The standard auras periodically apply their buff on nearby valid targets for a short duration.
If you want to make a scripted aura you'd just have to pick units around the unit bestowing your custom aura on a periodic basis and then apply your desired effect. Then you'd need something in place to remove this effect when affected units are no longer near the aura.
Making a truly custom aura can be useful (e.g. an aura that increases maximum health, an aura whose effects ramp up over time) but it is difficult and can be a performance concern depending on the extent of the aura (how often it picks nearby units, and how many units it is picking). You should just try and use the modified base auras where possible, like Devotion that gives negative armor.
That said I code mostly in GUI so there might be a much more efficient way to do it in the other languages.