JavaScript imposition - inserting imposition snippets
While typing JavaScript after reading all the documentation can certainly be fun, often it's easier to start with snippets of code and modify them as required.
This functionality is available in pdfToolbox 16 and later.
Inserting a JavaScript imposition snippet
To get the list of snippets, click on the "i" button.

The "i" button located at the top right of the JavaScript imposition editor.

In the menu that appears, select the "Insert imposition objects..." option. The dialog with snippets appears.

In this dialog, you can select the snippet you want from the list (2), or type into the search field (1) to find it.
Tips & tricks
The snippets that are inserted can be quite verbose, and they often are not valid JavaScript code without some modifications. For example, this is the code inserted for the addPage snippet:
// Add a page from the input document into a specific slot on an imposed sheet.
// 'sheetID' should be the result of a call to imposition.addSheet().
// 'slotID' should be the result of a call to imposition.addSlot().
// The page index is 0 - based.
imposition.addPage(sheetID, slotID, pageIndex);
To make this code work, you need to have variables called "sheetID", "slotID", and "pageIndex" or you have to edit the invocation to "addPage" to use your variables. That being said, the snippet does show you the correct call signature and explains where these arguments should come from.