xtmissingfill is a Stata command I am currently working on to balance a panel and fill in missing values. If you want to preview a copy of it prior to its release, please contact me and I will send you a copy of the newest version. The help file explains the replacement options for missing values and provides examples at the end of the file so please give it a read. To download the dataset for the examples:
. use "http://repec.org/bocode/m/municipality.dta", clear
. save "municipality.dta", replace
Be sure you do not have a dataset with the same name in your present working directory.