Do i even want to get started on this?....
First off blackjack HAS WAY! WAY! MORE THINGS then just "Hit me". Second $rand(1,9)...? in blackjack Ace can be 1 or 11 and there is no "1" card unless you make a ace 1, also there is more then one card that is ten making the odds of getting a ten are greater then getting say a 5 or 6. What is with the freeze? it's called stand.
Now for your scripting, there is no need for all the unsets like that you can use:
unset %cards %bcards %ctotal %btotal
same for all the global vars by using:
var -g %cards = w/e, %bcards = w/e, %ctotal = w/e
For your if statements you use halt at the end when putting in the second if elseif making it not check the elseif unless the if was = to $false.
Overall this script could be a lot better and have more of the blackjack options like really blackjack does.