When I open the script using nano on the server, I can see that indeed my indentation was not saved properly by WinSCP. I have no workaround for this. I've been forced to update scripts using VI or nano, which is less than optimal.
My PC is running Windows 10 Enterprise
My WinSCP version is 5.21.1
I'm not aware of any updates to my platform that coincide with the start of this issue.