for the version part, it really depends how you have built your model.
If you have built it with native Anaplan versions, then you should simply have the switchover on your forecast in which case the forecast contains the actuals already. If you can't have the switchover you'll have no choice but to [SELECT:Versions.actuals]
For doing the last 12, Id' use the formula MOVINGSUM like this:
you could probably combine it if it was taking huge space, but it is better to split the formulas, for performance. Also, you might be re-using the movingsum result some other place in the future and that means you won't have to write back the formula.
I am confused why you think you will need 20 line items. Are you taking the movingsum for 10 different line items? If this is the case, then simply create a line item subset of those 10 line items, and in a CALC module, create your movingsum based off the line item subset with the same dimensionality (versions, time, Product???, and the line item subset).
@nathan_rudman is absolutely correct in this for a native versions standpoint and using switchover. If you are using the version and switchover, when you are looking at Forecast, the previous Actuals will be rendered and be part of the movingsum.