David, I believe the easiest way to deal with this situation would be to use the data flow task. Given this would mean multiple sql statements for each line, but...
I'm guessing the reason that you want to use a script task rather than a conditional split is that you don't know how to do the check you need outside...
Mohan, in order to get or set global variables in SSIS you must first set those variables in the script task to be ReadOnly or ReadWrite Variables in the task...