[SCRIPTS] GetIndexedScript call can deadlock

GetIndexedScript can deadlock since they perform blocking operation
on the network thread. This commit moves the blocking to an async operation