Well if you really want to do this you should be writing a node! No question about it. Scriptjobs are not meant to be persistent actors. Scriptjobs are agents of a graphical user interface and not Maya core. So it sound to me you want to make a expression instead.
As a general observation with 10 years of experience behind them is that whenever people propose to use scriptjobs they are with 99% certainty doing something that they shouldnt do. Such as forcing a worldview thats backwards to how maya operates. There are valid use cases for scriptjobs however. But before you venture into this land be sure you understand that each scriptjob you make will slow Maya down considerably. To this end you should consider that your lifetime limit for persistent scriptjobs is 1-2. That's right your allowed to make 1 script job that's persistent, and if your really smart you get to use a second one. If you make more than one you will be incrementally and irrevocably make your Maya into shit, worse is if you actually rely on your script jobs.
The biggest problem i have with scriptjobs is that they are really efficeint at meking you miss the entire point with maya. Odds are that there's a really simple way to do what your after without a scripjob. This way your likelihood of breaking something up is increased a lot. Sure scripjobs can do a lot of stuff seemingly easily, such as make sure you get fired at your first real job.
Use scripjobs very sparingly.
I want to know how scriptJob command works.
it registers a event when said event triggers it runs all code attached to that event. Since maya is in general not event based in this way this comes with a slight and surprising side effect. Maya doesn't run scripjobs all the time. Maya disables all scriptjobs when it goes into execution mode. This makes it VERY dangerous to rely on scripjobs if you arent a accustomed programmer.
So dont be supprised when the scripjob based action does not animate all that well. Thats what expressions and nodes are for,
So tell me how and where to save scriptJob command contained ".mel" file. which auto load with particular maya scene.
it doesn't matter, Maya doesn't auto load the mel in this manner. What you do is you make a scriptnode that executes said mel on file load. Also make SURE your script has a -killWithScene flag associated with the scriptjob or you just went viral.
When I restart maya. And try to execute the same thing all connections break..
Ok that is then a bad scriptjob, see its your job to ensure such things dont happen. Nothing magical exists to shield you form your own code. Your code needs to understand different possible start up conditions thats all.