Programmatically adding and removing users to a user reference field?
It should be pretty simple:


Load the node you are trying to modify using node_load().
Look for the user referencing field.
Modify the user referencing field.
Save the node using node_save().


I wrote those steps before looking at the example you linked, but after looking at it, it pretty much follows those steps. To answer your question regarding the language: The reason for that is that you are not supposed to hardcode the language key directly. If I am not mistaken, in Drupal 7 this key is something like 'und', but when you use a language on a node this key changes dynamically to something like 'es' or 'en'. If you hardcode the language key, then your code will be translation incompatible. Even if you don't use translation, it is still consider a good Drupal programming practice not to hardcode that language key ;)

If you follow the code that it is given in your link you will be fine.