I need to migrate scripts in Script Editor of plugin ScriptRunner(see above image), between different Jira instances.
Is there any REST API that I can call to dump and import those scripts?
There is no official API for this, it can be quite complex ensuring all the data is moved over correctly, including references to Jira entities like projects and users.
ScriptRunner has partnered with AppFire to offer this functionality, via their Configuration Manager app: Configuration Manager for Jira (CMJ)
If it is only script editor scripts you are interested in migrating (not configurations), you can copy the files from your Jira home directory to another instance, you should find a “scriptrunner” directory in there containing all files.
You may also want to have a look at Script Plugins. You’d need to copy the contents of your script roots to the plugin. It’s by no means perfect (see the known issues list for that component), but depending on your use case, it might be a good option for porting scripts & their configurations between instances.