If those are ID's (Primary Keys), you don't need any function, just a relationship.
Say you set up this relationship:
SomeTable::GlobalTextField = YourTable::PrimaryKey
If you paste this list of ID's into GlobalTextField, a portal to YourTable will list all of the records for which you just pasted those IDs. Then a button in the portal row can be clicked to use Go To Related Records to bring up that record.
Really simple soluction :) I will implement that.