How advantageous is it to (BA) when using spell attacks

If you have access to the hide action as a Bonus Action (BA) (either as a goblin or through rogues cunning action), how viable or advantageous is it use it often to get advantage on spell attack rolls?

I’d imagine it depens on among other:

  • Other possible BA uses, especially spells
  • Importance of hitting the specific spell attack vs action economy efficiency
  • Avoiding enemy focus
  • Chance of hiding successfully, distribution of limited ability score points and so on.