I'm not top posting.
The script should explain it all.
It is written for the latest stable lilypond.
It is somewhat lengthy as 4 different cases are shown.
----------- cut here -------------
% A grace note (\grace, \acciaccatura, \appoggiatura) at the beginning
% of a score results in a 6 bar tablature for (5-string) banjo with
% noteheads between lines instead of upon the line, except for this
% first grace note. (case 2 & 3).
% This does not happen if no grace note is at the beginning of the
% score (case 1 & 4)