first i'd make sure you are using blcli_execute for everything, includeing the getServerIdByName call...
what does 'Deletes 'Extended Object scripts' from the target Server's CT folder' ? what is a 'target server's ct folder' ? and why do you need a blpackage to do this ?
why are you running discovery (to create/validate the components) and then deleting them ?
why not do the whole thing in a single nsh script ?