Layout ready occurs after the layout manager determines the layout of the form. Adding an instance forces the layout manager to recalculate the layout of the form, causing layout ready event to occur. Etc etc, you're in an infinite loop. Try moving your script to doc:ready.
Chris
Adobe Enterprise Developer Support