Hi Ray.
Welcome to the Forum.
One of the issues you are going to be confronted with often is the fact that MetaStock doesn't deal with NULL values very well. Once you have started returning values for a function, a value must be returned on every bar after. In your case, you don't have to have any lines drawn until the first instance of the gap code, but for every bar after there will be values returned and lines drawn. All you can do is assign a value that will not cause too many clarity issues for reading the chart or rescaling issues.
Hope this helps.
wabbit
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK
For custom MetaStock programming : http://www.wabbit.com.au
My SkyPE status : 
My SkyPE account : wabbit.com.au