When the script is not bound to the spreadsheet you can still get IDs and use the IDs to make the move:
function moveSpreadsheet(spreadSheetID, newFolderID) {
//Get the spreadsheet file
let file = DriveApp.getFileById(spreadSheetID);
//Get the target folder
let newFolder = DriveApp.getFolderById(newFolderID);
//Move the file to the new folder
file.moveTo(newFolder);
}
To use this function you would need to already have the IDs. You can get the IDs by copying from the URLs as mentioned above. Spreadsheet IDs appear after "d/", and Folder IDs come at the end of the URL. If you already have the spreadsheet object, e.g. you programmatically created a new one, you can get its ID using the spreadsheet.getID() method.