persistent_variable is used internally in ezscript* ezcss* functions to be able to persist variables from node view if page is cached.
The line you refer to clears the whole value. You can use ezpagedata_set( string $key, mixed $value ) / ezpagedata_append( string $key, mixed $value ) as provided by ezwebin instead, they will not overwrite the whole variable but instead threat it as a hash.