Ok, once you have the ename of the block insert (say saved in a variable en) ... convert it to an ActiveX object using vlax-ename->vla-object ... let me give an example:
Code:
(defun c:test (/ en eo dblist dbprop)
(setq en (entsel)) ;Ask user to pick the block reference
(setq eo (vlax-ename->vla-object (car en))) ;Get the ActiveX object
;;Get the DB Props collection, converting it from a variant-safearray to a list
;;(setq dblist (vlax-safearray->list (vlax-variant-value (vla-GetDynamicBlockProperties eo))))
;; Could use this instead
(setq dblist (vlax-invoke eo 'GetDynamicBlockProperties))
(foreach dbprop dblist ;Step through each property in the collection
(if (= (vla-get-PropertyName dbprop) "VS-Name") ;Check if the current has the name as you gave it inside BEdit
(if (= (vlax-get dbprop 'Value) "1") ;Check if its current state is 1
(vlax-put dbprop 'Value "2") ;Then change it to 2
(vlax-put dbprop 'Value "1") ;Else change it to 1
) ;_ end of if
) ;_ end of if
) ;_ end of foreach
) ;_ end of defun
This would basically toggle between 1 & 2 each time the user picks the block. Notice that all Visibility States are strings, therefore the "1" and "2". I'm also using the undocumented vlax-get and vlax-put instead of vla-get-Value and vla-put-Value so I don't have to convert everything to variants.
Please note this is a quick and dirty example. There's no error checking and you need to modify the property name as you'd like.