Also I wonder why you are calling acs_object__delete first and then organization__delete - normally the latter should take care of the necessary object deletion automatically, no?
And what's the difference between these two queries:
select object_id from acs_objects where object_type=''organizations''
select party_id from parties where party_id in (select organization_id from organizations)
If organization subclasses parties (why not groups btw?), then they should return the same, or what am I missing here?