Unfortunately, it's not so easy to find a free JSON editor that will handle newlines and tabs.
I scoured the net recently in search of one, tried 5 or 6, and ended up with this one, as the only one that worked correctly:
Thomas Franz's JSON Editor at
Recommended. Works nicely.
Download it and follow the instructions in comment 77, and you'll have tabs working as well.
Equipped with a working editor you can simply paste your existing code into the "data" (aka "Definition") field of a user data item.
There's no size limit, although long pastes won't edit on the device (intentionally; there's no point in perusing kilobytes of code in a text field).