Note that the structure in the Layout Designer and in the Classic Designer are significantly different. JavaScript written for one cannot be used in the other and vice-versa. The code will need to be re-written to be used in the Layout Designer and there are limitations to what the code in the Layout Designer can do (it doesn't have direct access to the Form's structure and components and instead makes changes to the form via the LFForm object and it's properties and functions).
We would likely need to see your existing code to be able to provide any assistance with re-writing it.