Is this a scripting question in sheep's clothing?
It sounds like you're trying to Embed the link? Use the links panel flyout command to do so.
The linked file is a PSD which is large. If I embed the file, the size of the template also becomes large. I'm guessing the only way is to export it as a JPEG from Photoshop and then embed it?
Again, why is this in the scripting forum? It does not seem to have anything to do with scripting.
Your question just isn't clear.
If you delete the link without embedding it, of course things won't work.
If you embed the link in the layout, of course the layout will grow by the size of the image.
How else could this work?
Since your question doesn't make any sense, perhaps you could explain what you are trying to actually accomplish?
I noticed that some of the images in the indesign file are the images in the links folder. However, when I delete the links folder, Indesign complains the Links are missing however the images are still displayed in the indesign file.
What you see in InDesign when the link is missing is a low resolution preview of the image. You can print or export the preview without linking the proper image, but it will not look pixelated and ugly. You should find the original image and relink it.
Is it really a problem that the file size of the photoshop file is large?
There are many ways to reduce the size of an image file, but InDesign will generally crop and resample large images when exporting anyway, so the final pdf will often be much smaller than the original photoshop files used in it.