Disclaimer: have not tried using a swap file - only speaking theoretically...
Teoretically yes, but for a swap file you would need an external USB storage anyway, so I would rather use script_usbmount NVRAM variable to point to a script which creates the swap. This script will automatically be...