Take care here. If your G28 Z position is 0 then you may end up driving your print into your head.

G28 XY will home X and Y only and leave Z where it is. If you want to move Z away then you should really do it with relative positioning as you will have variable height prints.

So:
These two can be on the same line, both executed together as stated above.
G28 X < home X axis
G28 Y < home Y axis

Switch to relative mode
G91

Drop Z by 30 mm from current position.
G0 Z 30

That should be safe for anything unless I have missed something.