Fixed #25631 - File type & settings are now retained after node creation

Previously this information would be lost after the script was first saved and never re-populated from the profile in the environment!  This is now fixed so that the file type and settings are always updated to match the current profile.
I'm not  big fan of elsing most of a function tbh if it's simpler to just return.  The answer to this post pretty much sums up my thinking: http://stackoverflow.com/questions/1419278/control-flow-via-return-vs-if-else
:)