Actually, since the nested check is a 'per DataObjectManager' check, you should move to to withing the init function and make it a local variable of that DataObjectManager. Otherwise, you won't be able to handle multiple nested/unnested DataObjectManagers very cleanly, and there is the possibility (as above) of the object model not being ready for to test.
In other works, remove line three and add:
$.fn.DataObjectManager.init = function(obj) {
var $container = $(obj);
var nested = $container.hasClass('isNested');
var container_id = '#'+$container.attr('id');
Since nested is only referenced from within this function, it keeps it within scope and removes the need to test for nested before initialisation.