Welcome to Atlassian Community!
You could use the REST API to do this and Scriptrunner should work too, but you should really consider it you want to add those 3000 plus options. The select field doesn't have a hard limit, but you will run into performance issues, see this question.
Another option would be to use an external data source and an app like Elements Connect, I used that when I was on Data Center and we needed to add a field that had 10000+ part numbers.
No, your issue is that you will run into performance issues when someone will try and use the field. I would consider using an external data source, or if you have access to Insight use that instead because the field values are populated when the user is typing in the field instead of having to wait for the list to first populate before you can see them. And by using external data source or Insight you can easily maintain the list rather than having to do it from the custom field.
To add to @Mikael Sandberg 's advice, you should be aware that humans struggle with most lists longer than about 42 items. Cloud Jira actively limits the number offered. Your 5400 list is unlikely to be of any practical use - you will find that if humans are using the field rather than automation, it's mostly full of random junk.
Also consider ScriptRunner database fields - https://docs.adaptavist.com/sr4js/latest/features/script-fields/built-in-script-fields/database-picker
It will lazily load values as the user types, they could be stored in an external database, or a csv/excel file etc.