I also can't think of any solid guideline that could be generally followed as this is 'offtopic'. Technically the title of the question is fine, it's the 'how to do it' that's the problem. But then again... that's because I know the "how to is 'curses'" if I didn't know that... I might not have a problem with the question.
My ultimate decision is that the question itself is not offtopic, however the answer is better served by SO. Sometimes you ask a question and don't know that until you get an answer.
Like here: Q: How do I make a program like Top A: Curses this requires a follow up question that's offtopic. Q: How do I use Curses with $language? A: Offtopic ask on SO.
If you don't know that this involves more advanced programming to start then you might not realize the end result is not appropriate on unix SE.
I wonder though... should we modify the question, or something to pose that a follow up should be on SO?
As far as Shell Programming in general I think it depends... I have no problems with simple scripting... much like the questions I've been asking. But when you get into writing a lot of functions, complexity or external library use, then I'd say it goes to SO. Truthfully the problem here is that the shell is a fundamental part of Unix. The fact that you can do everything to the system via CLI that you could via GUI is a part of what makes Unix great. I'm certainly ok with 'scripting' but it's hard to tell where shell scripting ends and shell programming begins.
I think the real answer here is to play it on a case by case scenario.
update When in doubt it's unix