I believe you can achieve what you are after with the following script:
//Set Months
V1 = MONTHNUM() ;
//Find Change from December to Jan
V2 = V1 == 1 and V1[1] == 12;
//Find 15 Bars into Jan
V3 = TIMESINCESIGNAL(V2) == 15;
//Find Change from June to July
V4 = V1 == 7 and V1[1] == 6;
//Find 15 Bars into July
V5 = TIMESINCESIGNAL(V4) == 15;
//Set 15 Day Moving Average
V6 = MA(BARS=15, CALC=OHLC) ;
//Set Switch between the two Date Zones
V7 = SWITCH(V3,V5);
//Find 15SMA Value for each zome
RES1 = VALUEWHEN(V6,V3);
RES2 = VALUEWHEN(V6,V5);
//Show MA Value based on which Date Zone we are in
IF(V7 == 1,RES1,RES2)
Here is how it looks on a chart:
The plot shows the average of the first 15 days of Jan and July each year.