I would assign UpValues to the symbol fun. See the documentation for TagSet and UpSet, which are interchangeable here:
(* Initialize, UpSet syntax *)
In[1]:= HowManyTimesHasBeenRunning[fun] ^= 0;
funResult[fun] ^= {};
(* Function definition, TagSet syntax *)
In[3]:= fun[] := (
fun /: HowManyTimesHasBeenRunning[fun] =
HowManyTimesHasBeenRunning[fun] + 1;
fun /: funResult[fun] = Append[funResult[fun], result1]
)
In[4]:= fun[]
Out[4]= {result1}
In[5]:= fun[]
Out[5]= {result1, result1}
In[6]:= fun[]
Out[6]= {result1, result1, result1}
In[9]:= HowManyTimesHasBeenRunning[fun]
Out[9]= 3
In[10]:= funResult[fun]
Out[10]= {result1, result1, result1}
By using UpValues, all values are assigned to the symbol fun instead of HowManyTimesHasBeenRunning and funResult, which remain undefined:
In[11]:= Definition[fun]
Out[11]=
funResult[fun]^={result1,result1,result1}
HowManyTimesHasBeenRunning[fun]^=3
fun[]:=(fun/:HowManyTimesHasBeenRunning[fun] = HowManyTimesHasBeenRunning[fun]+1;
fun/:funResult[fun]=Append[funResult[fun],result1])
In[16]:= Defintion[HowManyTimesHasBeenRunning]
Out[16]= Defintion[HowManyTimesHasBeenRunning]
Note that I just wrote result1 every time. You may of course replace that with some actual code.