So for each number that's been clicked on, you can set it's state to 'selected' whether by a boolean, or by numbers.
+on number clicked >set number.selected to true.. (or set number.selected to 1)
then to total all the numbers selected :
+for each number
+number is selected (or number.selected = 1)
>add number.value to TotalSum (a global or local variable)
where number.value, of course, is an instance variable containing the actual number visible on the block/cell