Hi @ShaneG
if you're certain that the form is NOT yet there when you set the values, and there is no other form, then set "categoryID" to the form ID.
Note: categoryID is a shortcut to the first custom form attached - which means if there already is a form attached, setting categoryID will effectively replace that existing form.
If it's possible that other forms may already be there, use the MiscAction module, and choose the action "assignCategories" just prior to setting the custom fields.