You want to make a node. Script jobs get suspended when maya updates the dg s you cant use this to any other effect than to notify a gui, sluggishly about change. In effect script jobs do very little useful stuff beyond GUI work.* Also tools don't fire attribute changes in the nodes they manipulate.
So now for any sane solution we would need to know a outline of what the function does.
*In fact theres a few rules of thumb that shows your doing something wrong. Using a scriptjob is one of the most clearest indicator that your doing something you probably should not.