Instead of using the serie of prevMember.prevMember... calls you can use the Lag MDX function function as following :
WITH
MEMBER [Measures].[Visits Moving Avg] AS
AVG(
[TIME].[Time].prevMember : [TIME].[Time].prevMember.lag(30)
, [Measures].[VISITS]
), SOLVE_ORDER = 0
By the way, it looks like currentMember is missing in your query; you are currently computing the moving average for the defaultMember of the [Time] dimension. The query using the currentMember of the time dimension is as following :
WITH
MEMBER [Measures].[Visits Moving Avg] AS
AVG(
[TIME].[Time].currentMemBer.prevMember
: [TIME].[Time].currentMemBer.prevMember.lag(30)
, [Measures].[VISITS]
), SOLVE_ORDER = 0