I sometimes here casual phrases in English like a hipping and a hopping (a hippin and a hoppin).
How exactly does this fit into English grammar and what is the history of the construct?
If you have access to the Oxford English Dictionary (e.g. through your local library), this is covered under a, prep.1. The OED considers it to be a variant of the preposition on. It includes both a number of senses where it introduces a regular noun — quotations include “Those fat and fair Objects that make their mouths run a-water so” from 1664 and “He was here a Sunday” from 1996 — and a number of senses where it introduces a gerund, with quotations going as far back as the 1200s.
Grammar-wise, you can mostly think of it as an explicit participle marker; whereas “going” can be either a gerund (“Going there is fun!”) or a participle (“We’re going there!”), “a-going” can only be a participle (“We’re a-going there!”).
Per the OED, it can also sometimes have a passive sense (e.g. “abuilding” meaning “being built”); but then, the bare present participle can also sometimes have a passive sense (called the “passival”), so I guess that’s still in line with its being an explicit participle marker of sorts.