I usually create and edit nodes, programmatically, using node_load and the node_save, and addind data to fields in this way:
$node->field_custom['lang'][0]['value'] = 'My value';
But in this way I've to check lang, and even if my node is "it" same fields (as terms, or other fields) need "und" and something like this.
Is there way to create and edit nodes loading the form and the submitting the form with new values?